comparison Framework/Loaders/LoaderStateMachine.cpp @ 956:a7351ad54960

Made IsContextLost automatically set the flag by checking with the emscripten WebGL wrapper + added a LOT of logging messages right before throwing ErrorCode_BadSequenceOfCalls exceptions + increased the http request timeouts from 60 to 600 sec (big datasets in some recent customer use cases) + added IsContext lost through the Viewport/Context layer (to make it reachable from external API) + the same for the underlying device context (for debug)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 21 Aug 2019 16:16:30 +0200
parents 47fc7919977d
children 91f827272c1f
comparison
equal deleted inserted replaced
953:118fc5c85d07 956:a7351ad54960
65 65
66 void LoaderStateMachine::Start() 66 void LoaderStateMachine::Start()
67 { 67 {
68 if (active_) 68 if (active_)
69 { 69 {
70 LOG(ERROR) << "LoaderStateMachine::Start() called while active_ is true";
70 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 71 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
71 } 72 }
72 73
73 active_ = true; 74 active_ = true;
74 75
104 } 105 }
105 106
106 107
107 void LoaderStateMachine::HandleExceptionMessage(const OracleCommandExceptionMessage& message) 108 void LoaderStateMachine::HandleExceptionMessage(const OracleCommandExceptionMessage& message)
108 { 109 {
109 LOG(ERROR) << "Error in the state machine, stopping all processing"; 110 LOG(ERROR) << "LoaderStateMachine::HandleExceptionMessage: error in the state machine, stopping all processing";
110 LOG(ERROR) << "Error: " << message.GetException().What() << " Details: " << 111 LOG(ERROR) << "Error: " << message.GetException().What() << " Details: " <<
111 message.GetException().GetDetails(); 112 message.GetException().GetDetails();
112 Clear(); 113 Clear();
113 } 114 }
114
115 115
116 template <typename T> 116 template <typename T>
117 void LoaderStateMachine::HandleSuccessMessage(const T& message) 117 void LoaderStateMachine::HandleSuccessMessage(const T& message)
118 { 118 {
119 assert(activeCommands_ > 0); 119 assert(activeCommands_ > 0);
161 161
162 void LoaderStateMachine::SetSimultaneousDownloads(unsigned int count) 162 void LoaderStateMachine::SetSimultaneousDownloads(unsigned int count)
163 { 163 {
164 if (active_) 164 if (active_)
165 { 165 {
166 LOG(ERROR) << "LoaderStateMachine::SetSimultaneousDownloads called while active_ is true";
166 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 167 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
167 } 168 }
168 else if (count == 0) 169 else if (count == 0)
169 { 170 {
170 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 171 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);