Mercurial > hg > orthanc-stone
changeset 1833:3c0996f028a1
merge
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 07 Jun 2021 18:47:10 +0200 |
parents | c2c24079238e (current diff) a03260db8835 (diff) |
children | 126522623e20 |
files | |
diffstat | 5 files changed, 18 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp Mon Jun 07 18:46:57 2021 +0200 +++ b/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp Mon Jun 07 18:47:10 2021 +0200 @@ -156,6 +156,7 @@ { std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + command->SetCallerName("DicomStructureSetLoader::RestInstanceLookupHandler::LookupInstance"); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags"; command->SetUri(uri); @@ -173,6 +174,7 @@ ++it) { std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + command->SetCallerName("DicomStructureSetLoader::RestInstanceLookupHandler"); command->SetUri("/tools/lookup"); command->SetMethod(Orthanc::HttpMethod_Post); command->SetBody(*it); @@ -479,6 +481,7 @@ { std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + command->SetCallerName("DicomStructureSetLoader::LoadInstance"); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050";
--- a/OrthancStone/Sources/Loaders/LoaderStateMachine.cpp Mon Jun 07 18:46:57 2021 +0200 +++ b/OrthancStone/Sources/Loaders/LoaderStateMachine.cpp Mon Jun 07 18:47:10 2021 +0200 @@ -134,10 +134,11 @@ void LoaderStateMachine::HandleExceptionMessage(const OracleCommandExceptionMessage& message) { - LOG(ERROR) << "LoaderStateMachine::HandleExceptionMessage: error in the state machine, stopping all processing"; + LOG(ERROR) << "LoaderStateMachine::HandleExceptionMessage: error in the state machine, stopping all processing. Caller: " + << message.GetOrigin().GetCallerName(); LOG(ERROR) << "Error: " << message.GetException().What() << " Details: " << message.GetException().GetDetails(); - Clear(); + Clear(); } template <typename T> @@ -155,8 +156,8 @@ } catch (Orthanc::OrthancException& e) { - LOG(ERROR) << "Error in the state machine, stopping all processing: " << - e.What() << " Details: " << e.GetDetails(); + LOG(ERROR) << "Error in the state machine, stopping all processing. Caller: " << + message.GetOrigin().GetCallerName() << ". Error: " << e.What() << " Details: " << e.GetDetails(); Clear(); } }
--- a/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp Mon Jun 07 18:46:57 2021 +0200 +++ b/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp Mon Jun 07 18:47:10 2021 +0200 @@ -104,6 +104,7 @@ // mandatory for RT-DOSE, but is too long to be returned by default std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + command->SetCallerName("OrthancMultiframeVolumeLoader::LoadGeometry"); command->SetUri("/instances/" + loader.GetInstanceId() + "/content/" + Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR.Format()); command->AcquirePayload(new LoadRTDoseGeometry(loader, dicom.release())); @@ -177,6 +178,7 @@ transferSyntaxUid_ == "1.2.840.10008.1.2.2") { std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + command->SetCallerName("OrthancMultiframeVolumeLoader::ScheduleFrameDownloads"); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetUri("/instances/" + instanceId_ + "/content/" + Orthanc::DICOM_TAG_PIXEL_DATA.Format() + "/0"); @@ -615,6 +617,7 @@ { std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + command->SetCallerName("OrthancMultiframeVolumeLoader::LoadInstance"); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetUri("/instances/" + instanceId + "/tags"); command->AcquirePayload(new LoadGeometry(*this)); @@ -623,6 +626,7 @@ { std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); + command->SetCallerName("OrthancMultiframeVolumeLoader::LoadInstance"); command->SetUri("/instances/" + instanceId + "/metadata/TransferSyntax"); command->AcquirePayload(new LoadTransferSyntax(*this)); Schedule(command.release());
--- a/OrthancStone/Sources/Oracle/IOracleCommand.h Mon Jun 07 18:46:57 2021 +0200 +++ b/OrthancStone/Sources/Oracle/IOracleCommand.h Mon Jun 07 18:47:10 2021 +0200 @@ -47,6 +47,8 @@ virtual Type GetType() const = 0; + virtual std::string GetCallerName() const = 0; + // This only clones the command, *not* its possibly associated payload virtual IOracleCommand* Clone() const = 0; };
--- a/OrthancStone/Sources/Oracle/OracleCommandBase.h Mon Jun 07 18:46:57 2021 +0200 +++ b/OrthancStone/Sources/Oracle/OracleCommandBase.h Mon Jun 07 18:47:10 2021 +0200 @@ -35,6 +35,7 @@ { private: std::unique_ptr<Orthanc::IDynamicObject> payload_; + std::string callerName_; public: void AcquirePayload(Orthanc::IDynamicObject* payload); @@ -46,6 +47,9 @@ virtual Orthanc::IDynamicObject& GetPayload() const; + void SetCallerName(const std::string callerName) { callerName_ = callerName; } + virtual std::string GetCallerName() const { return callerName_; } + Orthanc::IDynamicObject* ReleasePayload(); }; }