changeset 840:47fc7919977d

Added details on errors in LoaderStateMachine + dummy change in loader.cpp
author Benjamin Golinvaux <bgo@osimis.io>
date Sun, 09 Jun 2019 18:47:34 +0200
parents c47031d9f6b1
children 266e2b0b9abc
files Framework/Loaders/LoaderStateMachine.cpp Samples/Sdl/Loader.cpp
diffstat 2 files changed, 61 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Loaders/LoaderStateMachine.cpp	Mon Jun 03 14:37:17 2019 +0200
+++ b/Framework/Loaders/LoaderStateMachine.cpp	Sun Jun 09 18:47:34 2019 +0200
@@ -107,7 +107,9 @@
   void LoaderStateMachine::HandleExceptionMessage(const OracleCommandExceptionMessage& message)
   {
     LOG(ERROR) << "Error in the state machine, stopping all processing";
-    Clear();
+    LOG(ERROR) << "Error: " << message.GetException().What() << " Details: " <<
+      message.GetException().GetDetails();
+      Clear();
   }
 
 
@@ -124,7 +126,8 @@
     }
     catch (Orthanc::OrthancException& e)
     {
-      LOG(ERROR) << "Error in the state machine, stopping all processing: " << e.What();
+      LOG(ERROR) << "Error in the state machine, stopping all processing: " << 
+        e.What() << " Details: " << e.GetDetails();
       Clear();
     }
   }
--- a/Samples/Sdl/Loader.cpp	Mon Jun 03 14:37:17 2019 +0200
+++ b/Samples/Sdl/Loader.cpp	Sun Jun 09 18:47:34 2019 +0200
@@ -367,67 +367,69 @@
     oracle.Schedule(*toto, command.release());
   }
   
-  if (0)
-  {
-    std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
-    command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Jpeg)));
-    command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview");
-    oracle.Schedule(*toto, command.release());
-  }
-  
-  if (0)
-  {
-    std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
-    command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png)));
-    command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview");
-    oracle.Schedule(*toto, command.release());
-  }
-  
-  if (0)
+  if(0)
   {
-    std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
-    command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png)));
-    command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
-    oracle.Schedule(*toto, command.release());
-  }
-  
-  if (0)
-  {
-    std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
-    command->SetHttpHeader("Accept-Encoding", "gzip");
-    command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam)));
-    command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
-    oracle.Schedule(*toto, command.release());
-  }
-  
-  if (0)
-  {
-    std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
-    command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam)));
-    command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
-    oracle.Schedule(*toto, command.release());
-  }
+    if (0)
+    {
+      std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
+      command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Jpeg)));
+      command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview");
+      oracle.Schedule(*toto, command.release());
+    }
+    
+    if (0)
+    {
+      std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
+      command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png)));
+      command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview");
+      oracle.Schedule(*toto, command.release());
+    }
+    
+    if (0)
+    {
+      std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
+      command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png)));
+      command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
+      oracle.Schedule(*toto, command.release());
+    }
+    
+    if (0)
+    {
+      std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
+      command->SetHttpHeader("Accept-Encoding", "gzip");
+      command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam)));
+      command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
+      oracle.Schedule(*toto, command.release());
+    }
+    
+    if (0)
+    {
+      std::auto_ptr<OrthancStone::GetOrthancImageCommand>  command(new OrthancStone::GetOrthancImageCommand);
+      command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam)));
+      command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16");
+      oracle.Schedule(*toto, command.release());
+    }
 
-  if (0)
-  {
-    std::auto_ptr<OrthancStone::GetOrthancWebViewerJpegCommand>  command(new OrthancStone::GetOrthancWebViewerJpegCommand);
-    command->SetHttpHeader("Accept-Encoding", "gzip");
-    command->SetInstance("e6c7c20b-c9f65d7e-0d76f2e2-830186f2-3e3c600e");
-    command->SetQuality(90);
-    oracle.Schedule(*toto, command.release());
-  }
+    if (0)
+    {
+      std::auto_ptr<OrthancStone::GetOrthancWebViewerJpegCommand>  command(new OrthancStone::GetOrthancWebViewerJpegCommand);
+      command->SetHttpHeader("Accept-Encoding", "gzip");
+      command->SetInstance("e6c7c20b-c9f65d7e-0d76f2e2-830186f2-3e3c600e");
+      command->SetQuality(90);
+      oracle.Schedule(*toto, command.release());
+    }
 
 
-  if (0)
-  {
-    for (unsigned int i = 0; i < 10; i++)
+    if (0)
     {
-      std::auto_ptr<OrthancStone::SleepOracleCommand> command(new OrthancStone::SleepOracleCommand(i * 1000));
-      command->SetPayload(new Orthanc::SingleValueObject<unsigned int>(42 * i));
-      oracle.Schedule(*toto, command.release());
+      for (unsigned int i = 0; i < 10; i++)
+      {
+        std::auto_ptr<OrthancStone::SleepOracleCommand> command(new OrthancStone::SleepOracleCommand(i * 1000));
+        command->SetPayload(new Orthanc::SingleValueObject<unsigned int>(42 * i));
+        oracle.Schedule(*toto, command.release());
+      }
     }
   }
-
   
   // 2017-11-17-Anonymized
 #if 0