diff Platforms/Generic/Oracle.cpp @ 309:14ef1227120f am-callable-and-promise

web services: better handling of failures
author am@osimis.io
date Fri, 28 Sep 2018 15:02:43 +0200
parents 46c5296d867e
children b70e9be013e4
line wrap: on
line diff
--- a/Platforms/Generic/Oracle.cpp	Tue Sep 25 15:14:53 2018 +0200
+++ b/Platforms/Generic/Oracle.cpp	Fri Sep 28 15:02:43 2018 +0200
@@ -66,7 +66,15 @@
         if (item.get() != NULL)
         {
           IOracleCommand& command = dynamic_cast<IOracleCommand&>(*item);
-          command.Execute();
+          try
+          {
+            command.Execute();
+          }
+          catch (Orthanc::OrthancException& ex)
+          {
+            // this is probably a curl error that has been triggered.  We may just ignore it.
+            // The command.success_ will stay at false and this will be handled in the command.Commit
+          }
 
           // Random sleeping to test
           //boost::this_thread::sleep(boost::posix_time::milliseconds(50 * (1 + rand() % 10)));