changeset 6432:3b13fc5cd42b

cppcheck: rethrowNoCurrentException
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Nov 2025 16:50:23 +0100
parents bbb80ae2d652
children 0ebe8cfd9bf7 eda564f847d0
files OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp OrthancFramework/UnitTestsSources/RestApiTests.cpp OrthancServer/Resources/RunCppCheck-2.17.1.sh
diffstat 3 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp	Tue Nov 18 16:42:13 2025 +0100
+++ b/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp	Tue Nov 18 16:50:23 2025 +0100
@@ -1562,7 +1562,7 @@
 
     if (components.size() != 2)
     {
-      throw;
+      throw OrthancException(ErrorCode_InternalError);
     }
 
     int a = boost::lexical_cast<int>(components[0]);
@@ -1571,7 +1571,7 @@
         b < 0 || b > 15 ||
         (a == 0 && b == 0))
     {
-      throw;
+      throw OrthancException(ErrorCode_InternalError);
     }
 
     result[i] = static_cast<uint8_t>(a * 16 + b);
--- a/OrthancFramework/UnitTestsSources/RestApiTests.cpp	Tue Nov 18 16:42:13 2025 +0100
+++ b/OrthancFramework/UnitTestsSources/RestApiTests.cpp	Tue Nov 18 16:50:23 2025 +0100
@@ -1316,7 +1316,7 @@
       {
         if (b[i] != ('0' + i % 7))
         {
-          throw;
+          throw OrthancException(ErrorCode_InternalError);
         }
       }
       
--- a/OrthancServer/Resources/RunCppCheck-2.17.1.sh	Tue Nov 18 16:42:13 2025 +0100
+++ b/OrthancServer/Resources/RunCppCheck-2.17.1.sh	Tue Nov 18 16:50:23 2025 +0100
@@ -13,16 +13,17 @@
 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:292
 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:391
 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:286
-constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp
-constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp
-constParameterCallback:../../OrthancFramework/Sources/Pkcs11.cpp
+constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp:50
+constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp:112
+constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp:113
+constParameterCallback:../../OrthancFramework/Sources/Pkcs11.cpp:125
 constParameterCallback:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp:3489
-constParameterCallback:../../OrthancServer/Sources/OrthancGetRequestHandler.cpp
+constParameterCallback:../../OrthancServer/Sources/OrthancGetRequestHandler.cpp:47
 constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:447
 constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:451
 constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3046
 constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3053
-constParameterPointer:../../OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h
+constParameterPointer:../../OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h:2181
 cstyleCast:../../OrthancServer/Plugins/Engine/PluginsManager.cpp:108
 cstyleCast:../../OrthancServer/Plugins/Engine/PluginsManager.cpp:124
 cstyleCast:../../OrthancServer/Plugins/Engine/PluginsManager.cpp:140
@@ -30,10 +31,17 @@
 knownConditionTrueFalse:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:114
 knownConditionTrueFalse:../../OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:425
 knownConditionTrueFalse:../../OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp:345
-knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2291
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2292
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2293
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2294
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2295
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2296
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2297
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2298
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2299
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2300
 nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:322
-rethrowNoCurrentException:../../OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp
-rethrowNoCurrentException:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp
 stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1525
 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:166
 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:74