Mercurial > hg > orthanc
changeset 6923:d602f35554c5 streaming
integration mainline -> streaming
line wrap: on
line diff
--- a/NEWS Wed Jun 03 18:17:50 2026 +0200 +++ b/NEWS Fri Jun 05 11:28:32 2026 +0200 @@ -16,6 +16,12 @@ * When the "IngestTranscoding" configuration is set to a compressed transfer syntax, Orthanc no longer transcodes DICOM files that do not have any pixel data (e.g. DICOM-SR, RTSTRUCT, Encapsulated PDF,...). Such files are sometimes poorly handled by other software. +* In Lua, added new functions to manage key-value stores in the Orthanc DB (provided that + the DB backend supports it: currently, PostgreSQL and SQLite): + - StoreKeyValue(storeId, key, value) + - value = GetKeyValue(storeId, key) + - DeleteKeyValue(storeId, key) + REST API -------- @@ -50,12 +56,16 @@ https://github.com/orthanc-server/orthanc-builder/issues/36 * Fix slow ingest of files containing huge arrays of float/double values in their DICOM tags: https://discourse.orthanc-server.org/t/orthanc-1-12-11-performance-issues-with-deformable-registrations/6448) -* Fix a Denial of Service via Deeply Nested DICOM Sequences: +* Fix a Denial of Service via Deeply Nested DICOM Sequences (CVE-2026-10528): https://orthanc.uclouvain.be/bugs/show_bug.cgi?id=258 Security issue reported by Jose Lopez Martinez (aka elpe_pinillo) from Deloitte. * Fixed various OOB read/write (TODO: finalize release notes) +* Lua: Fix the "ReceivedCStoreInstanceFilter" Lua callback whose return value was + not taken into account. * Upgraded dependencies for static builds: - - dcmtk 3.7.0 hot-fix: https://github.com/DCMTK/dcmtk/commit/847d50e83ae5bbfbc731c99c142ee1410303d222 + - dcmtk 3.7.0 hot-fix for CVE-2026-10528: + https://github.com/DCMTK/dcmtk/commit/885ff0f10372bd589b5f44cea974f28a3964cb0f + https://github.com/DCMTK/dcmtk/commit/847d50e83ae5bbfbc731c99c142ee1410303d222 Version 1.12.11 (2026-04-14)
--- a/OrthancFramework/Sources/ChunkedBuffer.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/ChunkedBuffer.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -188,7 +188,7 @@ { if (numBytes_ != 0) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } result.clear(); @@ -199,7 +199,7 @@ assert(chunks_.front() != NULL); if (chunks_.front()->size() != numBytes_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancFramework/Sources/Compression/GzipCompressor.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Compression/GzipCompressor.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -143,7 +143,7 @@ { // Cannot initialize zlib compressed.clear(); - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } // Compress the input buffer @@ -160,7 +160,7 @@ throw OrthancException(ErrorCode_NotEnoughMemory); default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -168,7 +168,7 @@ if (deflateEnd(&stream) != Z_OK) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } // The compression was successful @@ -293,7 +293,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); // Unknown error + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Unknown error } const size_t produced = chunk.size() - stream.avail_out;
--- a/OrthancFramework/Sources/Compression/ZipReader.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Compression/ZipReader.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -473,7 +473,7 @@ reader->pimpl_->reader_.reset(new MemoryBuffer(buffer, size)); if (reader->pimpl_->reader_.get() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } zlib_filefunc64_def funcs;
--- a/OrthancFramework/Sources/Compression/ZlibCompressor.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Compression/ZlibCompressor.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -85,7 +85,7 @@ throw OrthancException(ErrorCode_NotEnoughMemory); default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -157,7 +157,7 @@ throw OrthancException(ErrorCode_NotEnoughMemory); default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }
--- a/OrthancFramework/Sources/DataSource/DataSourceAnswer.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DataSource/DataSourceAnswer.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -98,7 +98,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancFramework/Sources/DataSource/DataSourceReader.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DataSource/DataSourceReader.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -205,7 +205,7 @@ } catch (...) { - error.reset(new OrthancException(ErrorCode_InternalError)); + error.reset(new OrthancException(ErrorCode_InternalError, "Unknown exception in Datasource::Run")); } // Phase 3: Acquire budget WITHOUT holding a strong reference to "DataSourceAnswer".
--- a/OrthancFramework/Sources/DataSource/DicomDataSource.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DataSource/DicomDataSource.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -198,7 +198,7 @@ if (!obj.EstimateValueSize(estimatedSize) || estimatedSize != size) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomImageInformation.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -184,11 +184,11 @@ } catch (boost::bad_lexical_cast&) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } catch (OrthancException&) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } @@ -196,7 +196,7 @@ { if (!values.ParseUnsignedInteger32(numberOfFrames_, DICOM_TAG_NUMBER_OF_FRAMES)) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } else
--- a/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -245,7 +245,7 @@ return instancesMainDicomTagsByLevel_; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancFramework/Sources/DicomFormat/DicomStreamReader.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomStreamReader.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -341,7 +341,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -466,7 +466,7 @@ { if (sequenceDepth_ == 0) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } sequenceDepth_ --; @@ -562,7 +562,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else
--- a/OrthancFramework/Sources/DicomFormat/DicomValue.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomValue.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -292,11 +292,11 @@ case Type_SequenceAsJson: { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -323,7 +323,7 @@ } else if (type == "Sequence") { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } else {
--- a/OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/DicomAssociation.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -61,7 +61,7 @@ // Add an empty sequence if (!dataset.insertEmptyElement(tag).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -75,7 +75,7 @@ !item->putAndInsertUint16(DCM_FailureReason, failureReasons[i]).good()) || !dataset.insertSequenceItem(tag, item.release()).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -737,7 +737,7 @@ DcmDataset dataset; if (!dataset.putAndInsertString(DCM_TransactionUID, transactionUid.c_str()).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } { @@ -916,7 +916,7 @@ DcmDataset dataset; if (!dataset.putAndInsertString(DCM_TransactionUID, transactionUid.c_str()).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } {
--- a/OrthancFramework/Sources/DicomNetworking/DicomAssociationParameters.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/DicomAssociationParameters.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -289,7 +289,7 @@ { if (target.type() != Json::objectValue) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancFramework/Sources/DicomNetworking/DicomConnectionInfo.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/DicomConnectionInfo.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -42,7 +42,7 @@ { if (target.type() != Json::objectValue) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/DicomControlUserConnection.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -150,7 +150,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } switch (level) @@ -569,7 +569,7 @@ sopClass = UID_GETStudyRootQueryRetrieveInformationModel; break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } // Figure out which of the accepted presentation contexts should be used @@ -947,7 +947,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } MoveInternal(targetAet, level, move, messageId); @@ -960,7 +960,7 @@ { if (!moveQuery.HasTag(DICOM_TAG_QUERY_RETRIEVE_LEVEL)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } const std::string tmp = moveQuery.GetValue(DICOM_TAG_QUERY_RETRIEVE_LEVEL).GetContent();
--- a/OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -234,7 +234,7 @@ { if (dicom.getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } OFString a, b; @@ -315,7 +315,7 @@ mandatory->second.find(transferSyntax) == mandatory->second.end()) { // Should never fail because of (*) - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (!ProposeStorageClass(sopClassUid, mandatory->second, hasPreferred, preferred)) @@ -425,7 +425,7 @@ if (dicom.getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } // Finally conduct transmission of data @@ -483,7 +483,7 @@ if (dicom.get() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } Store(sopClassUid, sopInstanceUid, *dicom, hasMoveOriginator, moveOriginatorAET, moveOriginatorID); @@ -641,7 +641,7 @@ if (!FromDcmtkBridge::LookupOrthancTransferSyntax(transcodedSyntax, transcoded.GetParsed()) || accepted.find(transcodedSyntax) == accepted.end()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -1103,7 +1103,7 @@ if (msg->CommandField != DIMSE_N_ACTION_RQ /* value == 304 == 0x0130 */ || !server_.HasStorageCommitmentRequestHandlerFactory()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } @@ -1239,7 +1239,7 @@ if (msg->CommandField != DIMSE_N_EVENT_REPORT_RQ /* value == 256 == 0x0100 */ || !server_.HasStorageCommitmentRequestHandlerFactory()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); }
--- a/OrthancFramework/Sources/DicomNetworking/Internals/GetScp.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/Internals/GetScp.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -144,7 +144,7 @@ if (processedCount > handler.GetSubOperationCount()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } response.NumberOfRemainingSubOperations = (handler.GetSubOperationCount() - processedCount);
--- a/OrthancFramework/Sources/DicomNetworking/TimeoutDicomConnectionManager.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/TimeoutDicomConnectionManager.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -58,7 +58,7 @@ if (that_.connection_.get() == NULL) { // The allocation should have been done by "that_.Open()" in the constructor - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -118,7 +118,7 @@ if (dicom.getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DicomTransferSyntax syntax; @@ -410,7 +410,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else
--- a/OrthancFramework/Sources/DicomParsing/DicomDirWriter.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/DicomDirWriter.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -187,7 +187,7 @@ if (!target.putAndInsertString(key, s.c_str()).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -442,7 +442,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (!found) @@ -480,7 +480,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } CopyStringType1C(*record, dataset, encoding, hasCodeExtensions, DCM_SpecificCharacterSet); @@ -498,7 +498,7 @@ EET_UndefinedLength /*encodingType*/, EGL_withoutGL /*groupLength*/).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } file_.Read(s);
--- a/OrthancFramework/Sources/DicomParsing/DicomModification.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/DicomModification.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -515,7 +515,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::string original; @@ -938,7 +938,7 @@ if (vr != ValueRepresentation_LongString && vr != ValueRepresentation_NotSupported /* if no dictionary loaded */) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else if (*it == DICOM_TAG_PATIENT_NAME) @@ -946,13 +946,13 @@ if (vr != ValueRepresentation_PersonName && vr != ValueRepresentation_NotSupported /* if no dictionary loaded */) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else if (vr != ValueRepresentation_UniqueIdentifier && vr != ValueRepresentation_NotSupported /* for older versions of DCMTK */) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -1231,7 +1231,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -1562,7 +1562,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } assert(tmp2 != NULL);
--- a/OrthancFramework/Sources/DicomParsing/DicomWebJsonVisitor.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/DicomWebJsonVisitor.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -248,7 +248,7 @@ std::string t = FormatTag(tag); if (node.isMember(t)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -286,7 +286,7 @@ !(*node) [t].isMember(KEY_VALUE) || (*node) [t][KEY_VALUE].type() != Json::arrayValue) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -302,7 +302,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } node = &(*node) [t][KEY_VALUE][Json::ArrayIndex(parentIndexes[i])];
--- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -1303,7 +1303,7 @@ DcmElement* element = item.getElement(i); if (element == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DicomTag tag(FromDcmtkBridge::Convert(element->getTag())); @@ -1936,7 +1936,7 @@ E_TransferSyntax xfer; if (!LookupDcmtkTransferSyntax(xfer, syntax)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -2185,7 +2185,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2203,7 +2203,7 @@ case EVR_OB: // other byte case EVR_OW: // other word - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); case EVR_UN: // unknown value representation throw OrthancException(ErrorCode_ParameterOutOfRange); @@ -2562,7 +2562,7 @@ { if (!target.putAndInsertString(tag, value.c_str()).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2617,7 +2617,7 @@ if (!result->insert(tmp, false, false).good()) { delete tmp; - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -2846,7 +2846,7 @@ DcmElement* element = dataset.getElement(i); if (element == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -3035,7 +3035,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3503,7 +3503,7 @@ { if (dicom.getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -3666,7 +3666,7 @@ { if (!item.insertEmptyElement(key, OFTrue /* replace old value */).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }
--- a/OrthancFramework/Sources/DicomParsing/IDicomTranscoder.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/IDicomTranscoder.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -72,7 +72,7 @@ { if (dicom.getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DcmDataset& dataset = *dicom.getDataset(); @@ -99,7 +99,7 @@ if (parsed.getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::string targetSopInstanceUid = GetSopInstanceUid(parsed); @@ -108,7 +108,7 @@ { if (!allowNewSopInstanceUid && (targetSopInstanceUid != sourceSopInstanceUid)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -131,7 +131,7 @@ // No transcoding should have happened if (targetSopInstanceUid != sourceSopInstanceUid) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -147,14 +147,14 @@ case TranscodingType_Lossy: if (targetSopInstanceUid == sourceSopInstanceUid) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } break; case TranscodingType_Lossless: if (targetSopInstanceUid != sourceSopInstanceUid) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } break; @@ -176,7 +176,7 @@ { if (isExternalBuffer_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -216,7 +216,7 @@ } else if (parsed_->getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -256,7 +256,7 @@ } else if (parsed->getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else if (parsed_.get() != NULL) {
--- a/OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomFrameIndex.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -75,7 +75,7 @@ if (!item->getUint8Array(content).good() || content == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } table.resize(length / 4); @@ -115,7 +115,7 @@ DcmObject* fragment = pixelSequence_->nextInContainer(NULL); // Skip the offset table if (fragment == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } for (unsigned int i = 0; i < countFrames; i++) @@ -145,13 +145,13 @@ DcmObject* fragment = pixelSequence_->nextInContainer(NULL); if (fragment == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } fragment = pixelSequence_->nextInContainer(fragment); // Skip the offset table if (fragment == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } uint32_t offset = 0; @@ -214,7 +214,7 @@ if (!fragment->getUint8Array(content).good() || content == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } assert(offset + fragment->getLength() <= frame.size()); @@ -247,7 +247,7 @@ if (!fragment->getUint8Array(content).good() || content == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } return content; } @@ -341,7 +341,7 @@ virtual uint8_t* GetRawFrameBuffer(unsigned int index) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } };
--- a/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -358,7 +358,7 @@ << (info.IsPlanar() ? ", planar, " : ", non-planar, ") << EnumerationToString(info.GetPhotometricInterpretation()) << " photometric interpretation"; - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } return new Image(format, info.GetWidth(), info.GetHeight(), false); @@ -424,7 +424,7 @@ if (pixelData == NULL && !dataset.findAndGetUint8Array(DCM_PixelData, pixelData, &pixelLength).good()) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } if (info.IsPlanar() || @@ -486,13 +486,13 @@ if (!dataset.findAndGetUint16(DCM_BitsAllocated, bitsAllocated).good()) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } if (!dataset.findAndGetElement(DCM_PixelData, elem).good() || elem == NULL) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } // In implicit VR files, pixelLength is expressed in words (OW) although pixels can actually be 8 bits @@ -570,7 +570,7 @@ break; } - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } @@ -589,7 +589,7 @@ if (source.GetWidth() != target->GetWidth() || source.GetHeight() != target->GetHeight()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } @@ -664,7 +664,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } ImageProcessing::ShiftRight(*target, info.GetShift()); @@ -701,7 +701,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -726,7 +726,7 @@ if (source.GetFormat() != PixelFormat_RGB24 || 3 * width != source.GetPitch()) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } std::unique_ptr<ImageAccessor> target(new Image(PixelFormat_RGB24, width, height, false)); @@ -926,7 +926,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::unique_ptr<ImageAccessor> result(ApplyCodec(*decoder, parameters, representationParameter, dataset, frame)); @@ -990,7 +990,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::unique_ptr<ImageAccessor> result(ApplyCodec(*decoder, parameters, representationParameter, dataset, frame)); @@ -1150,7 +1150,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1199,7 +1199,7 @@ } else { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } }
--- a/OrthancFramework/Sources/DicomParsing/Internals/SopInstanceUidFixer.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/Internals/SopInstanceUidFixer.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -64,7 +64,7 @@ !target.getDataset()->putAndInsertString( DCM_SOPInstanceUID, sopInstanceUid_.c_str(), OFTrue /* replace */).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomDir.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomDir.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -57,7 +57,7 @@ if (found == offsetToIndex_.end()) { // Error in the algorithm that computes the offsets - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -96,7 +96,7 @@ if (item == NULL) { Clear(); - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } Uint32 next, lower;
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -392,7 +392,7 @@ } catch (std::bad_cast&) { - throw OrthancException(ErrorCode_InternalError); // This should never happen / but I don't know why this std::bad_cast has been introduced (probably a std::bad_cast from DCMTK) + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // This should never happen / but I don't know why this std::bad_cast has been introduced (probably a std::bad_cast from DCMTK) } return false; @@ -556,7 +556,7 @@ { // This field already exists delete element; - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1306,7 +1306,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1321,7 +1321,7 @@ accessor.GetFormat() != PixelFormat_RGBA32 && accessor.GetFormat() != PixelFormat_RGBA64) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } InvalidateCache(); @@ -1406,7 +1406,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } assert(bytesPerPixel != 0); @@ -1477,7 +1477,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } } @@ -1494,7 +1494,7 @@ if (!GetDcmtkObject().getDataset()->insert(pixels.release(), false, false).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1511,7 +1511,7 @@ if (!GetDcmtkObject().getDataset()->insert(pixels.release(), false, false).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1697,7 +1697,7 @@ if (dcmDataset == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (!this->HasTag(DICOM_TAG_PIXEL_DATA) && @@ -1815,7 +1815,7 @@ { if (GetDcmtkObjectConst().getDataset() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -1847,7 +1847,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (!ok) @@ -1877,7 +1877,7 @@ << (info.IsPlanar() ? ", planar, " : ", non-planar, ") << EnumerationToString(info.GetPhotometricInterpretation()) << " photometric interpretation"; - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } std::unique_ptr<ImageAccessor> img(new ImageAccessor()); @@ -2264,14 +2264,14 @@ case ValueRepresentation_OtherByte: if (!dataset.putAndInsertUint8Array(DCM_PixelData, NULL, 0).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } break; case ValueRepresentation_OtherWord: if (!dataset.putAndInsertUint16Array(DCM_PixelData, NULL, 0).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } break; @@ -2292,7 +2292,7 @@ DcmElement* element = dataset.getElement(i - 1); if (element == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (element->getTag().getGroup() > DCM_PixelData.getGroup() || @@ -2363,7 +2363,7 @@ !pixelSequence->storeCompressedFrame(offsetList, raw, content.size(), 0 /* unlimited fragment size */).good() || !offsetTable->createOffsetTable(offsetList).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::unique_ptr<DcmPixelData> pixelData(new DcmPixelData(DCM_PixelData)); @@ -2372,7 +2372,7 @@ if (!GetDcmtkObject().getDataset()->insert(pixelData.release(), true, false).good() || !GetDcmtkObject().getDataset()->chooseRepresentation(EXS_JPEGProcess1, NULL).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } #else throw OrthancException(ErrorCode_InternalError, "Orthanc was compiled without support for JPEG");
--- a/OrthancFramework/Sources/Enumerations.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Enumerations.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -2512,7 +2512,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancFramework/Sources/FileStorage/MemoryStorageArea.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/FileStorage/MemoryStorageArea.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -63,7 +63,7 @@ } else if (content_.find(uuid) != content_.end()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -107,7 +107,7 @@ } else if (found->second == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else if (end > found->second->size()) { @@ -140,7 +140,7 @@ } else if (found->second == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancFramework/Sources/FileStorage/StorageAccessor.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/FileStorage/StorageAccessor.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -172,7 +172,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -224,7 +224,7 @@ default: { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } }
--- a/OrthancFramework/Sources/HttpClient.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/HttpClient.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -229,7 +229,7 @@ if (curlBufferSize == 0) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (pendingPos_ + curlBufferSize <= pending_.size()) @@ -999,7 +999,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (method_ == HttpMethod_Post ||
--- a/OrthancFramework/Sources/HttpServer/HttpOutput.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/HttpServer/HttpOutput.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -192,7 +192,7 @@ if (state_ == State_WritingMultipart) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (state_ == State_WritingHeader) @@ -307,7 +307,7 @@ return; // Ignore default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -528,7 +528,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } LOG(TRACE) << "Compressing a HTTP answer using " << encoding; @@ -624,7 +624,7 @@ **/ if (boundary.size() != 36 + 1 + 36) // one UUID contains 36 characters { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } boundary.resize(70);
--- a/OrthancFramework/Sources/HttpServer/HttpServer.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/HttpServer/HttpServer.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -470,7 +470,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -1031,7 +1031,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else if (!path.empty() && @@ -1052,7 +1052,7 @@ Toolbox::SplitUriComponents(p, uri); if (p.empty()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } p.resize(p.size() - 1); @@ -1060,7 +1060,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -1220,7 +1220,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -1550,7 +1550,7 @@ { if (stream.get() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } postStatus = ReadBodyToStream(*stream, connection, headers, server.HasMaxBodySize(), server.GetMaxBodySize()); @@ -1588,7 +1588,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2333,7 +2333,7 @@ { if (handler_ == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } return *handler_;
--- a/OrthancFramework/Sources/HttpServer/HttpStreamTranscoder.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/HttpServer/HttpStreamTranscoder.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -39,7 +39,7 @@ { if (source_.SetupHttpCompression(false, false) != HttpCompression_None) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } uint64_t size = source_.GetContentLength(); @@ -60,7 +60,7 @@ if (offset != size) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -132,7 +132,7 @@ return SetupZlibCompression(deflateAllowed); default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -163,7 +163,7 @@ uint64_t length = source_.GetContentLength(); if (length < bytesToSkip_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } return length - bytesToSkip_;
--- a/OrthancFramework/Sources/HttpServer/WebDavStorage.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/HttpServer/WebDavStorage.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -281,7 +281,7 @@ { if (path.size() == 0) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else if (path.size() == 1) {
--- a/OrthancFramework/Sources/Images/Font.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/Font.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -252,7 +252,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -270,7 +270,7 @@ target.GetFormat() != PixelFormat_RGBA32 && target.GetFormat() != PixelFormat_BGRA32) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } int a = x;
--- a/OrthancFramework/Sources/Images/ImageAccessor.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/ImageAccessor.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -317,7 +317,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } buffer.Flatten(target);
--- a/OrthancFramework/Sources/Images/ImageProcessing.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/ImageProcessing.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -624,7 +624,7 @@ ApplyWindowingInternal<uint16_t, float>(target, source, windowCenter, windowWidth, rescaleSlope, rescaleIntercept, invert); break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } };break; case PixelFormat_Grayscale8: @@ -638,7 +638,7 @@ ApplyWindowingInternal<uint16_t, uint8_t>(target, source, windowCenter, windowWidth, rescaleSlope, rescaleIntercept, invert); break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } };break; case PixelFormat_Grayscale16: @@ -652,11 +652,11 @@ ApplyWindowingInternal<uint16_t, uint16_t>(target, source, windowCenter, windowWidth, rescaleSlope, rescaleIntercept, invert); break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } };break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1054,7 +1054,7 @@ return; } - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } @@ -1099,7 +1099,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1149,7 +1149,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } const unsigned int width = image.GetWidth(); @@ -1186,7 +1186,7 @@ if (alpha.GetFormat() != PixelFormat_Grayscale8) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } switch (image.GetFormat()) @@ -1204,7 +1204,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } const unsigned int width = image.GetWidth(); @@ -1254,7 +1254,7 @@ break; } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1283,7 +1283,7 @@ break; } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1330,7 +1330,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1359,7 +1359,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1383,7 +1383,7 @@ return; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1428,7 +1428,7 @@ return; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1502,7 +1502,7 @@ return; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1575,11 +1575,11 @@ return; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1653,7 +1653,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1665,7 +1665,7 @@ case PixelFormat_Grayscale8: return Invert(image, 255); default: - throw OrthancException(ErrorCode_NotImplemented); // you should use the Invert(image, maxValue) overload + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); // you should use the Invert(image, maxValue) overload } } @@ -1840,7 +1840,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1896,7 +1896,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -2298,7 +2298,7 @@ } else { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -2423,7 +2423,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -2473,7 +2473,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -2513,7 +2513,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -2805,7 +2805,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -3036,7 +3036,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -3110,7 +3110,7 @@ return; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -3139,7 +3139,7 @@ } else { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -3180,7 +3180,7 @@ } else { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } }
--- a/OrthancFramework/Sources/Images/JpegReader.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/JpegReader.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -63,7 +63,7 @@ } else { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } uint64_t pitch = static_cast<uint64_t>(cinfo.output_width) * cinfo.output_components;
--- a/OrthancFramework/Sources/Images/JpegWriter.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/JpegWriter.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -83,7 +83,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } jpeg_set_defaults(&cinfo);
--- a/OrthancFramework/Sources/Images/NumpyWriter.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/NumpyWriter.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -65,7 +65,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } unsigned int channels; @@ -98,7 +98,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } std::string depthString;
--- a/OrthancFramework/Sources/Images/PamReader.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/PamReader.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -69,7 +69,7 @@ return; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } else if (tupleType == "RGB" && @@ -88,12 +88,12 @@ return; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } else { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -256,7 +256,7 @@ if (bytesPerChannel != 1 && bytesPerChannel != 2) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } if (Toolbox::DetectEndianness() == Endianness_Little &&
--- a/OrthancFramework/Sources/Images/PamWriter.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/PamWriter.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -73,7 +73,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -100,7 +100,7 @@ if (bytesPerChannel != 1 && bytesPerChannel != 2) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } size_t targetPitch = static_cast<size_t>(channelCount) * bytesPerChannel * width;
--- a/OrthancFramework/Sources/Images/PngReader.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/PngReader.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -197,7 +197,7 @@ } else { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } uint64_t totalSize = pitch * height;
--- a/OrthancFramework/Sources/Images/PngWriter.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Images/PngWriter.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -173,7 +173,7 @@ break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -277,7 +277,7 @@ if (setjmp(png_jmpbuf(context.GetObject()))) { // Error during writing PNG - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } png_set_write_fn(context.GetObject(), &chunks, MemoryCallback, NULL);
--- a/OrthancFramework/Sources/JobsEngine/JobsEngine.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/JobsEngine/JobsEngine.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -102,7 +102,7 @@ return true; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -176,7 +176,7 @@ { if (registry_.get() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } return *registry_;
--- a/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -495,7 +495,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -550,7 +550,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } LOG(INFO) << "Job has completed with " << tmp << ": " << job.GetId(); @@ -952,7 +952,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else if (state == JobState_Success) @@ -1087,7 +1087,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } CheckInvariants(); @@ -1142,7 +1142,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } // WARNING: The following call might make "handler" invalid if @@ -1677,7 +1677,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }
--- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -97,7 +97,7 @@ { if (other.index_ <= index_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (!unserializing &&
--- a/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.h Fri Jun 05 11:28:32 2026 +0200 @@ -143,7 +143,7 @@ virtual void SetUserData(const Json::Value& userData) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual bool GetUserData(Json::Value& userData) const ORTHANC_OVERRIDE
--- a/OrthancFramework/Sources/JobsEngine/SetOfCommandsJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/JobsEngine/SetOfCommandsJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -174,7 +174,7 @@ { if (!started_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (commands_.empty() &&
--- a/OrthancFramework/Sources/Logging.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Logging.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -95,7 +95,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancFramework/Sources/MallocMemoryBuffer.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/MallocMemoryBuffer.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -61,7 +61,7 @@ { if (free_ == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } free_(buffer_);
--- a/OrthancFramework/Sources/MetricsRegistry.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/MetricsRegistry.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -111,7 +111,7 @@ case MetricsUpdatePolicy_MinOver1Minute: return 60; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancFramework/Sources/MultiThreading/FutureState.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/MultiThreading/FutureState.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -50,7 +50,7 @@ if (state_ != State_Success && state_ != State_Failed) { - throw OrthancException(ErrorCode_InternalError); // Should never happen + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Should never happen } } } @@ -85,7 +85,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); // Should never happen + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Should never happen } } } @@ -134,7 +134,7 @@ throw OrthancException(ErrorCode_BadSequenceOfCalls); default: - throw OrthancException(ErrorCode_InternalError); // Should never happen + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Should never happen } } } @@ -163,7 +163,7 @@ throw OrthancException(ErrorCode_BadSequenceOfCalls); default: - throw OrthancException(ErrorCode_InternalError); // Should never happen + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Should never happen } } }
--- a/OrthancFramework/Sources/MultiThreading/ThreadPool.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/MultiThreading/ThreadPool.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -165,7 +165,7 @@ default: if (throws) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancFramework/Sources/OrthancException.h Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/OrthancException.h Fri Jun 05 11:28:32 2026 +0200 @@ -31,6 +31,21 @@ #include <json/value.h> #include <stdint.h> // For uint16_t +#define THROW_WITH_FILE_AND_LINE_INFO(errorCode) throw OrthancException(errorCode) + +#if ORTHANC_ENABLE_LOGGING == 1 +// The macro __ORTHANC_FILE__ is only defined for gcc and clang, and if DefineSourceBasenameForTarget is called in CMake +# if defined(__ORTHANC_FILE__) +# undef THROW_WITH_FILE_AND_LINE_INFO +# define ORTHANC_EXCEPTION_STRINGIFY_LINE_HELPER(line) #line +# define ORTHANC_EXCEPTION_STRINGIFY_LINE(line) ORTHANC_EXCEPTION_STRINGIFY_LINE_HELPER(line) +# define THROW_WITH_FILE_AND_LINE_INFO(errorCode) \ + throw OrthancException( \ + errorCode, #errorCode " triggered from " __ORTHANC_FILE__ ":" \ + ORTHANC_EXCEPTION_STRINGIFY_LINE(__LINE__)) +# endif +#endif + namespace Orthanc { class ORTHANC_PUBLIC ErrorPayload
--- a/OrthancFramework/Sources/RestApi/RestApi.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/RestApi/RestApi.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -403,7 +403,7 @@ paths_[path].type() != Json::objectValue) || paths_[path].isMember(method)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } paths_[path][method] = v; @@ -474,7 +474,7 @@ case HttpMethod_Get: if (hasGet_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } hasGet_ = true; @@ -485,7 +485,7 @@ case HttpMethod_Post: if (hasPost_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } hasPost_ = true; @@ -496,7 +496,7 @@ case HttpMethod_Delete: if (hasDelete_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } hasDelete_ = true; @@ -507,7 +507,7 @@ case HttpMethod_Put: if (hasPut_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } hasPut_ = true; @@ -654,7 +654,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (verb.empty())
--- a/OrthancFramework/Sources/SharedLibrary.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/SharedLibrary.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -131,7 +131,7 @@ { if (!handle_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } #if defined(_WIN32)
--- a/OrthancFramework/Sources/Toolbox.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/Sources/Toolbox.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -1317,7 +1317,7 @@ return Endianness_Little; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1530,7 +1530,7 @@ } default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -1991,7 +1991,7 @@ if (Toolbox::DetectEndianness() != Endianness_Little) { // TODO - The data table must be swapped (uint16_t) - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } #endif @@ -2315,7 +2315,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } Dictionary::const_iterator found = dictionary_.find(key);
--- a/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -1375,7 +1375,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } ParsedDicomFile f(false); @@ -1570,7 +1570,7 @@ if (components.size() != 2) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } int a = boost::lexical_cast<int>(components[0]); @@ -1579,7 +1579,7 @@ b < 0 || b > 15 || (a == 0 && b == 0)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } result[i] = static_cast<char>(a * 16 + b); @@ -1992,7 +1992,7 @@ DcmTagKey v = ToDcmtkBridge::Convert(value); if (!element->putTagVal(v).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } dicom.GetDcmtkObject().getDataset()->insert(element.release()); @@ -2409,7 +2409,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2926,7 +2926,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2964,7 +2964,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2987,7 +2987,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3013,7 +3013,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3037,7 +3037,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3070,7 +3070,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3426,7 +3426,7 @@ case 1: bitsAllocated = 8; break; case 2: bitsAllocated = 16; break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } for (Syntaxes::const_iterator it = compressedSyntaxes.begin(); it != compressedSyntaxes.end(); ++it) @@ -3493,7 +3493,7 @@ case 0: bitsAllocated = 1; break; case 1: bitsAllocated = 8; break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } ASSERT_EQ(ValueRepresentation_OtherByte, DicomImageInformation::GuessPixelDataValueRepresentation(DicomTransferSyntax_LittleEndianExplicit, bitsAllocated));
--- a/OrthancFramework/UnitTestsSources/JobsTests.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/UnitTestsSources/JobsTests.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -142,7 +142,7 @@ virtual void SetUserData(const Json::Value& userData) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual bool GetUserData(Json::Value& userData) const ORTHANC_OVERRIDE @@ -173,7 +173,7 @@ { if (trailingStepDone_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -183,7 +183,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -307,7 +307,7 @@ q.Enqueue(new DynamicInteger(10, s)); q.Enqueue(new DynamicInteger(20, s)); ASSERT_EQ(2, s.size()); - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } catch (OrthancException&) { @@ -407,7 +407,7 @@ q.Enqueue(o10, 0); q.Enqueue(o20, 0); ASSERT_EQ(2, s.size()); - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } catch (OrthancException&) {
--- a/OrthancFramework/UnitTestsSources/RestApiTests.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancFramework/UnitTestsSources/RestApiTests.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -1315,7 +1315,7 @@ { if (b[i] != ('0' + i % 7)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -232,7 +232,7 @@ { if (that_.activeTransaction_ != NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } that_.activeTransaction_ = this; @@ -574,7 +574,7 @@ { if (!labels.empty()) { - throw OrthancException(ErrorCode_InternalError); // "HasLabelsSupport()" has returned "false" + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // "HasLabelsSupport()" has returned "false" } if (that_.extensions_.lookupResources == NULL) @@ -1428,27 +1428,27 @@ virtual void AddLabel(int64_t resource, const std::string& label) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void RemoveLabel(int64_t resource, const std::string& label) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void ListLabels(std::set<std::string>& target, int64_t resource) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void ListAllLabels(std::set<std::string>& target) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void StoreKeyValue(const std::string& storeId, @@ -1456,20 +1456,20 @@ const void* value, size_t valueSize) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void DeleteKeyValue(const std::string& storeId, const std::string& key) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual bool GetKeyValue(std::string& value, const std::string& storeId, const std::string& key) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void ListKeysValues(std::list<std::string>& keys, @@ -1479,26 +1479,26 @@ const std::string& from, uint64_t limit) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void EnqueueValue(const std::string& queueId, const void* value, size_t valueSize) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual bool DequeueValue(std::string& value, const std::string& queueId, QueueOrigin origin) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual uint64_t GetQueueSize(const std::string& queueId) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual bool ReserveQueueValue(std::string& value, @@ -1507,26 +1507,26 @@ QueueOrigin origin, uint32_t releaseTimeout) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void AcknowledgeQueueValue(const std::string& queueId, uint64_t valueId) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void GetAttachmentCustomData(std::string& customData, const std::string& attachmentUuid) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); // Not supported } virtual void SetAttachmentCustomData(const std::string& attachmentUuid, const void* customData, size_t customDataSize) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); // Not supported } }; @@ -1753,6 +1753,6 @@ uint64_t OrthancPluginDatabase::MeasureLatency() { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } }
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -807,7 +807,7 @@ { if (!labels.empty()) { - throw OrthancException(ErrorCode_InternalError); // "HasLabelsSupport()" has returned "false" + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // "HasLabelsSupport()" has returned "false" } std::vector<OrthancPluginDatabaseConstraint> constraints; @@ -1040,27 +1040,27 @@ virtual void AddLabel(int64_t resource, const std::string& label) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void RemoveLabel(int64_t resource, const std::string& label) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void ListLabels(std::set<std::string>& target, int64_t resource) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void ListAllLabels(std::set<std::string>& target) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void StoreKeyValue(const std::string& storeId, @@ -1068,20 +1068,20 @@ const void* value, size_t valueSize) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void DeleteKeyValue(const std::string& storeId, const std::string& key) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual bool GetKeyValue(std::string& value, const std::string& storeId, const std::string& key) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void ListKeysValues(std::list<std::string>& keys, @@ -1091,26 +1091,26 @@ const std::string& from, uint64_t limit) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void EnqueueValue(const std::string& queueId, const void* value, size_t valueSize) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual bool DequeueValue(std::string& value, const std::string& queueId, QueueOrigin origin) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual uint64_t GetQueueSize(const std::string& queueId) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual bool ReserveQueueValue(std::string& value, @@ -1119,26 +1119,26 @@ QueueOrigin origin, uint32_t releaseTimeout) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void AcknowledgeQueueValue(const std::string& queueId, uint64_t valueId) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Not supported } virtual void GetAttachmentCustomData(std::string& customData, const std::string& attachmentUuid) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); // Not supported } virtual void SetAttachmentCustomData(const std::string& attachmentUuid, const void* customData, size_t customDataSize) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); // Not supported + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); // Not supported } }; @@ -1296,7 +1296,7 @@ return new Transaction(*this, listener, OrthancPluginDatabaseTransactionType_ReadWrite); default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1337,7 +1337,7 @@ uint64_t OrthancPluginDatabaseV3::MeasureLatency() { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } }
--- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -491,7 +491,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1045,7 +1045,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1065,7 +1065,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1304,7 +1304,7 @@ if (!database_.GetDatabaseCapabilities().HasLabelsSupport() && !labels.empty()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DatabasePluginMessages::TransactionRequest request; @@ -1507,7 +1507,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1526,7 +1526,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1886,7 +1886,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1904,7 +1904,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1934,7 +1934,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1965,7 +1965,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1991,7 +1991,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2015,7 +2015,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DatabasePluginMessages::TransactionResponse response; @@ -2034,7 +2034,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2053,7 +2053,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2080,7 +2080,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DatabasePluginMessages::TransactionResponse response; @@ -2100,7 +2100,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2119,7 +2119,7 @@ else { // This method shouldn't have been called - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancServer/Plugins/Engine/OrthancPlugins.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Plugins/Engine/OrthancPlugins.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -1030,7 +1030,7 @@ return new PluginStorageAreaV3(callbacks3_, errorDictionary_); default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }; @@ -1454,7 +1454,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -1619,7 +1619,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (error == OrthancPluginErrorCode_Success) @@ -1690,7 +1690,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (error != OrthancPluginErrorCode_Success) @@ -1712,7 +1712,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }; @@ -1953,7 +1953,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } Reset(); @@ -2057,7 +2057,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (error != OrthancPluginErrorCode_Success) @@ -2107,7 +2107,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }; @@ -2235,7 +2235,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -2286,7 +2286,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (driver == NULL) @@ -2309,7 +2309,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }; @@ -2652,7 +2652,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } converted_.groups = matcher.GetGroups(); @@ -3027,7 +3027,7 @@ SignalChangeInternal(OrthancPluginChangeType_JobFailure, OrthancPluginResourceType_None, event.GetJobId().c_str()); break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3731,7 +3731,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::vector<std::string> result; @@ -3899,7 +3899,7 @@ return; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -4092,7 +4092,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -4125,7 +4125,7 @@ return; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -4666,7 +4666,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -4845,7 +4845,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } *(p.target) = ReturnImage(result); @@ -5217,7 +5217,7 @@ if (target.get() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -6419,7 +6419,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -6559,7 +6559,7 @@ } case _OrthancPluginService_DatabaseAnswer: - throw OrthancException(ErrorCode_InternalError); // Implemented before locking (*) + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Implemented before locking (*) case _OrthancPluginService_RegisterErrorCode: { @@ -6896,6 +6896,11 @@ { boost::shared_lock<boost::shared_mutex> lock(pimpl_->decoderTranscoderMutex_); + if (static_cast<uint64_t>(size) > static_cast<uint64_t>(std::numeric_limits<uint32_t>::max())) + { + throw OrthancException(ErrorCode_InternalError, "Cannot decode frame since DICOM size that is too large (size is limited to 32bits in this version of the plugin SDK)"); + } + for (PImpl::DecodeImageCallbacks::const_iterator decoder = pimpl_->decodeImageCallbacks_.begin(); decoder != pimpl_->decodeImageCallbacks_.end(); ++decoder) @@ -7092,7 +7097,7 @@ if (method != HttpMethod_Post && method != HttpMethod_Put) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } RestCallbackMatcher matcher(uri);
--- a/OrthancServer/Plugins/Engine/PluginsJob.h Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Plugins/Engine/PluginsJob.h Fri Jun 05 11:28:32 2026 +0200 @@ -87,7 +87,7 @@ virtual void SetUserData(const Json::Value& userData) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual bool GetUserData(Json::Value& userData) const ORTHANC_OVERRIDE
--- a/OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -125,7 +125,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } candidates.Intersect(matches);
--- a/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -71,7 +71,7 @@ if (!IsResourceLevelAboveOrEqual(topLevel, bottomLevel) || topLevel == bottomLevel) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::list<int64_t> currentResources;
--- a/OrthancServer/Sources/Database/Compatibility/ILookupResourceAndParent.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/Compatibility/ILookupResourceAndParent.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -50,7 +50,7 @@ int64_t parentId; if (!database.LookupParent(parentId, id)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } parentPublicId = database.GetPublicId(parentId);
--- a/OrthancServer/Sources/Database/Compatibility/SetOfResources.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/Compatibility/SetOfResources.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -111,7 +111,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancServer/Sources/Database/FindResponse.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/FindResponse.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -136,7 +136,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -511,7 +511,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -522,7 +522,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -665,7 +665,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }
--- a/OrthancServer/Sources/Database/ResourcesContent.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/ResourcesContent.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -93,7 +93,7 @@ // This would require to handle the incrementation of revision // numbers in the database backend => only allow setting // metadata on new resources - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } @@ -129,7 +129,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } StoreMainDicomTagsInternal(*this, resource, tags); // saves only leaf tags, not sequences
--- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -295,7 +295,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } assert(statement.get() != NULL); @@ -610,7 +610,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1293,7 +1293,7 @@ }; break; default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } } @@ -1854,7 +1854,7 @@ } else if (!s.ColumnBlobAsString(0, &customData)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -2325,7 +2325,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } // "reservedUntil <= ?" indicates that the reservation has expired @@ -2347,7 +2347,7 @@ int64_t id = s.ColumnInt64(0); if (id < 0) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } valueId = static_cast<uint64_t>(id); @@ -2425,7 +2425,7 @@ } else if (db_.GetLastChangeCount() > 1) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } return true; @@ -2457,7 +2457,7 @@ } else if (db_.GetLastChangeCount() > 1) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }; @@ -2663,7 +2663,7 @@ if (that_.activeTransaction_ != NULL) { isNested_ = true; - // throw OrthancException(ErrorCode_InternalError); + // THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -2688,7 +2688,7 @@ { if (fileSizeDelta != 0) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }; @@ -3002,7 +3002,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3091,7 +3091,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.h Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.h Fri Jun 05 11:28:32 2026 +0200 @@ -97,7 +97,7 @@ virtual uint64_t MeasureLatency() ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual bool HasIntegratedFind() const ORTHANC_OVERRIDE
--- a/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -434,7 +434,7 @@ if ((readOperations == NULL && writeOperations == NULL) || (readOperations != NULL && writeOperations != NULL)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (factory_.get() == NULL) @@ -1108,7 +1108,7 @@ uint64_t& dicomUncompressedSize_; const std::string& publicId_; ResourceType type_; - const IDatabaseWrapper::Capabilities& dbCapabilities_; + IDatabaseWrapper::Capabilities dbCapabilities_; public: explicit Operations(uint64_t& diskSize, @@ -1151,8 +1151,106 @@ } } + void ApplyWithoutFind(ReadOnlyTransaction& transaction) + { + int64_t top; + if (!transaction.LookupResource(top, type_, publicId_)) + { + throw OrthancException(ErrorCode_UnknownResource); + } + else + { + countInstances_ = 0; + countSeries_ = 0; + countStudies_ = 0; + diskSize_ = 0; + uncompressedSize_ = 0; + dicomDiskSize_ = 0; + dicomUncompressedSize_ = 0; + + std::stack<int64_t> toExplore; + toExplore.push(top); + + while (!toExplore.empty()) + { + // Get the internal ID of the current resource + int64_t resource = toExplore.top(); + toExplore.pop(); + + ResourceType thisType = transaction.GetResourceType(resource); + + std::set<FileContentType> f; + transaction.ListAvailableAttachments(f, resource); + + for (std::set<FileContentType>::const_iterator + it = f.begin(); it != f.end(); ++it) + { + FileInfo attachment; + int64_t revision; // ignored + if (transaction.LookupAttachment(attachment, revision, resource, *it)) + { + if (attachment.GetContentType() == FileContentType_Dicom) + { + dicomDiskSize_ += attachment.GetCompressedSize(); + dicomUncompressedSize_ += attachment.GetUncompressedSize(); + } + + diskSize_ += attachment.GetCompressedSize(); + uncompressedSize_ += attachment.GetUncompressedSize(); + } + } + + if (thisType == ResourceType_Instance) + { + countInstances_++; + } + else + { + switch (thisType) + { + case ResourceType_Study: + countStudies_++; + break; + + case ResourceType_Series: + countSeries_++; + break; + + default: + break; + } + + // Tag all the children of this resource as to be explored + std::list<int64_t> tmp; + transaction.GetChildrenInternalId(tmp, resource); + for (std::list<int64_t>::const_iterator + it = tmp.begin(); it != tmp.end(); ++it) + { + toExplore.push(*it); + } + } + } + + if (countStudies_ == 0) + { + countStudies_ = 1; + } + + if (countSeries_ == 0) + { + countSeries_ = 1; + } + } + } + virtual void Apply(ReadOnlyTransaction& transaction) ORTHANC_OVERRIDE { + if (!dbCapabilities_.HasFindSupport()) + { + ApplyWithoutFind(transaction); // use legacy code + return; + } + countInstances_ = 0; countSeries_ = 0; countStudies_ = 0; @@ -1192,7 +1290,7 @@ // don't count patients break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1341,7 +1439,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else @@ -1638,7 +1736,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } // If we have not reached the Patient level, find the parent of @@ -2271,7 +2369,7 @@ series == -1 || instance == -1) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (limitToThisLevelDicomTags_) @@ -2415,7 +2513,7 @@ hasPatientToAvoid = transaction_.LookupResource(patientToAvoid, type, newPatientId); if (type != ResourceType_Patient) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3782,7 +3880,7 @@ else if (currentKey_ != keys_.end() || currentValue_ != values_.end()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -3851,7 +3949,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); // Should never happen + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); // Should never happen } }
--- a/OrthancServer/Sources/Database/VoidDatabaseListener.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Database/VoidDatabaseListener.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -31,17 +31,17 @@ void VoidDatabaseListener::SignalRemainingAncestor(ResourceType parentType, const std::string& publicId) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } void VoidDatabaseListener::SignalAttachmentDeleted(const FileInfo& info) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } void VoidDatabaseListener::SignalResourceDeleted(ResourceType type, const std::string& publicId) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancServer/Sources/DicomInstanceOrigin.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/DicomInstanceOrigin.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -67,7 +67,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancServer/Sources/ExportedResource.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ExportedResource.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -55,7 +55,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }
--- a/OrthancServer/Sources/LuaScripting.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/LuaScripting.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -229,7 +229,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } { @@ -279,7 +279,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } { @@ -333,7 +333,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } { @@ -387,7 +387,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } { @@ -635,6 +635,170 @@ } + // Syntax in Lua: StoreKeyValue(storeId, key, value) + int LuaScripting::StoreKeyValue(lua_State* state) + { + ServerContext* serverContext = GetServerContext(state); + if (serverContext == NULL) + { + LOG(ERROR) << "Lua: The Orthanc API is unavailable"; + lua_pushnil(state); + return 1; + } + + // Check the types of the arguments + int nArgs = lua_gettop(state); + if (nArgs != 3 || + !lua_isstring(state, 1) || // storeId + !lua_isstring(state, 2) || // key + !lua_isstring(state, 3)) // value + { + LOG(ERROR) << "Lua: Bad parameters to StoreKeyValue()"; + lua_pushnil(state); + return 1; + } + + if (!serverContext->GetIndex().HasKeyValueStoresSupport()) + { + LOG(ERROR) << "Lua: Unable to use StoreKeyValue() when the DB backend does not support Key-Value stores"; + lua_pushnil(state); + return 1; + } + + + const char* storeId = lua_tostring(state, 1); + const char* key = lua_tostring(state, 2); + const char* value = lua_tostring(state, 3); + + try + { + serverContext->GetIndex().StoreKeyValue(storeId, key, value); + + return 1; + } + catch (OrthancException& e) + { + LOG(ERROR) << "Lua: " << e.What(); + } + + LOG(ERROR) << "Lua: Error in StoreKeyValue() for storeId: " << storeId; + lua_pushnil(state); + + return 1; + } + + + // Syntax in Lua: value = GetKeyValue(storeId, key) + int LuaScripting::GetKeyValue(lua_State* state) + { + ServerContext* serverContext = GetServerContext(state); + if (serverContext == NULL) + { + LOG(ERROR) << "Lua: The Orthanc API is unavailable"; + lua_pushnil(state); + return 1; + } + + // Check the types of the arguments + int nArgs = lua_gettop(state); + if (nArgs != 2 || + !lua_isstring(state, 1) || // storeId + !lua_isstring(state, 2)) // key + { + LOG(ERROR) << "Lua: Bad parameters to GetKeyValue()"; + lua_pushnil(state); + return 1; + } + + if (!serverContext->GetIndex().HasKeyValueStoresSupport()) + { + LOG(ERROR) << "Lua: Unable to use GetKeyValue() when the DB backend does not support Key-Value stores"; + lua_pushnil(state); + return 1; + } + + + const char* storeId = lua_tostring(state, 1); + const char* key = lua_tostring(state, 2); + + try + { + std::string value; + if (serverContext->GetIndex().GetKeyValue(value, storeId, key)) + { + lua_pushlstring(state, value.c_str(), value.size()); + } + else + { + lua_pushnil(state); + return 1; + } + + return 1; + } + catch (OrthancException& e) + { + LOG(ERROR) << "Lua: " << e.What(); + } + + LOG(ERROR) << "Lua: Error in GetKeyValue() for storeId: " << storeId; + lua_pushnil(state); + + return 1; + } + + + // Syntax in Lua: DeleteKeyValue(storeId, key, value) + int LuaScripting::DeleteKeyValue(lua_State* state) + { + ServerContext* serverContext = GetServerContext(state); + if (serverContext == NULL) + { + LOG(ERROR) << "Lua: The Orthanc API is unavailable"; + lua_pushnil(state); + return 1; + } + + // Check the types of the arguments + int nArgs = lua_gettop(state); + if (nArgs != 2 || + !lua_isstring(state, 1) || // storeId + !lua_isstring(state, 2)) // key + { + LOG(ERROR) << "Lua: Bad parameters to DeleteKeyValue()"; + lua_pushnil(state); + return 1; + } + + if (!serverContext->GetIndex().HasKeyValueStoresSupport()) + { + LOG(ERROR) << "Lua: Unable to use DeleteKeyValue() when the DB backend does not support Key-Value stores"; + lua_pushnil(state); + return 1; + } + + + const char* storeId = lua_tostring(state, 1); + const char* key = lua_tostring(state, 2); + + try + { + serverContext->GetIndex().DeleteKeyValue(storeId, key); + + return 1; + } + catch (OrthancException& e) + { + LOG(ERROR) << "Lua: " << e.What(); + } + + LOG(ERROR) << "Lua: Error in DeleteKeyValue() for storeId: " << storeId; + lua_pushnil(state); + + return 1; + } + + // Syntax in Lua: GetOrthancConfiguration() int LuaScripting::GetOrthancConfiguration(lua_State *state) { @@ -773,7 +937,7 @@ if (operations.type() != Json::arrayValue) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } LuaJobManager::Lock lock(pimpl_->jobManager_, context_.GetJobsEngine()); @@ -786,13 +950,13 @@ if (operations[i].type() != Json::objectValue || !operations[i].isMember("Operation")) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } const Json::Value& parameters = operations[i]; if (!parameters.isMember("Resource")) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::string operation = parameters["Operation"].asString(); @@ -827,6 +991,9 @@ lua_.RegisterFunction("RestApiDelete", RestApiDelete); lua_.RegisterFunction("GetOrthancConfiguration", GetOrthancConfiguration); lua_.RegisterFunction("SetStableStatus", SetStableStatus); + lua_.RegisterFunction("StoreKeyValue", StoreKeyValue); + lua_.RegisterFunction("GetKeyValue", GetKeyValue); + lua_.RegisterFunction("DeleteKeyValue", DeleteKeyValue); LOG(INFO) << "Initializing Lua for the event handler"; LoadGlobalConfiguration(); @@ -1057,7 +1224,7 @@ return true; } - bool LuaScripting::FilterIncomingCStoreInstance(uint16_t& /*dimseStatus*/, + bool LuaScripting::FilterIncomingCStoreInstance(uint16_t& dimseStatus, const DicomInstanceToStore& instance, const Json::Value& simplified) { @@ -1087,10 +1254,16 @@ int result; call.ExecuteToInt(result); - return static_cast<uint16_t>(result); + if (result > 0xFFFF || result < 0) + { + throw OrthancException(ErrorCode_ParameterOutOfRange, "The returned DIMSE status should be >= 0 and <= 0xFFFF"); + } + + dimseStatus = static_cast<uint16_t>(result); + return dimseStatus == 0; // keep if DimseStatus is SUCCESS } - return true; + return true; // keep }
--- a/OrthancServer/Sources/LuaScripting.h Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/LuaScripting.h Fri Jun 05 11:28:32 2026 +0200 @@ -64,6 +64,10 @@ static int RestApiDelete(lua_State *state); static int GetOrthancConfiguration(lua_State *state); static int SetStableStatus(lua_State* state); + + static int StoreKeyValue(lua_State* state); + static int GetKeyValue(lua_State* state); + static int DeleteKeyValue(lua_State* state); void InitializeJob();
--- a/OrthancServer/Sources/OrthancFindRequestHandler.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancFindRequestHandler.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -338,7 +338,7 @@ level != ResourceType_Series && level != ResourceType_Instance) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } DicomArray query(*filteredInput);
--- a/OrthancServer/Sources/OrthancGetRequestHandler.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancGetRequestHandler.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -86,7 +86,7 @@ if (instancesLoader_.get() == NULL || !instancesLoader_->HasNext()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } {
--- a/OrthancServer/Sources/OrthancHttpHandler.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancHttpHandler.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -42,7 +42,7 @@ if (method != HttpMethod_Post && method != HttpMethod_Put) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } for (Handlers::const_iterator it = handlers_.begin(); it != handlers_.end(); ++it) @@ -52,7 +52,7 @@ { if (target.get() == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } return true; @@ -106,7 +106,7 @@ { if (orthancRestApi_ == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } return *orthancRestApi_;
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestAnonymizeModify.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestAnonymizeModify.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -843,7 +843,7 @@ if (siblingInstances.empty()) { // Error: No instance (should never happen) - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } siblingInstanceId = siblingInstances.front(); @@ -891,7 +891,7 @@ std::string tmp; if (!context.GetIndex().LookupParent(tmp, parent)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } parent = tmp; @@ -1023,7 +1023,7 @@ { if (encapsulate) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } else {
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -682,7 +682,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -744,7 +744,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestArchive.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestArchive.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -314,7 +314,7 @@ bool deflateAllowed) ORTHANC_OVERRIDE { // This function is not called by HttpOutput::AnswerWithoutBuffering() - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } virtual bool HasContentFilename(std::string& filename) ORTHANC_OVERRIDE @@ -330,7 +330,7 @@ virtual uint64_t GetContentLength() ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } virtual bool ReadNextChunk() ORTHANC_OVERRIDE @@ -378,7 +378,7 @@ { if (done_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -390,7 +390,7 @@ { if (done_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -984,7 +984,7 @@ << query.GetHandler().GetRemoteModality().GetApplicationEntityTitle(); }; break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } job->SetQueryFormat(OrthancRestApi::GetDicomFormat(body, DicomToJsonFormat_Short)); @@ -1346,7 +1346,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -2498,7 +2498,7 @@ if (sopClassUids.size() != sopInstanceUids.size()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } const std::string transactionUid = Toolbox::GenerateDicomPrivateUniqueIdentifier();
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -579,7 +579,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1000,7 +1000,7 @@ { if (dicom == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DicomMap tags; @@ -1114,7 +1114,7 @@ { if (dicom == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } PhotometricInterpretation photometric; @@ -2985,7 +2985,7 @@ (resourceType == ResourceType_Instance && module == DicomModule_Instance) || (resourceType == ResourceType_Instance && module == DicomModule_Image))) { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } ServerContext& context = OrthancRestApi::GetContext(call); @@ -3183,7 +3183,7 @@ .AddAnswerType(MimeType_Json, "A JSON object with the `Count` of matching resources"); break; default: - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } return; @@ -3597,7 +3597,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -913,7 +913,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } call.GetDocumentation() @@ -950,7 +950,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (ok) @@ -1105,7 +1105,7 @@ } } - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); }
--- a/OrthancServer/Sources/OrthancWebDav.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/OrthancWebDav.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -134,7 +134,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (hasUid && @@ -338,7 +338,7 @@ count++; } - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1043,7 +1043,7 @@ { if (path.size() != 7) // Format: "YYYY-MM" { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -1297,7 +1297,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1424,7 +1424,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DicomIdentifiersVisitorV2 visitor(collection);
--- a/OrthancServer/Sources/ResourceFinder.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ResourceFinder.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -124,7 +124,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -200,7 +200,7 @@ } else { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } } } @@ -223,7 +223,7 @@ if (resource.GetLevel() != request_.GetLevel()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } target = Json::objectValue; @@ -251,7 +251,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -281,7 +281,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -333,7 +333,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -357,7 +357,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::string s; @@ -703,7 +703,7 @@ if (IsComputedTag(constraint.GetTag()) && constraint.GetTag() != DICOM_TAG_MODALITIES_IN_STUDY) { // Sanity check - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -1098,7 +1098,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (lookup_.get() != NULL) @@ -1262,7 +1262,7 @@ case FindStorageAccessMode_DatabaseOnly: return false; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1344,7 +1344,7 @@ if (answer.type() != Json::arrayValue) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else if (answer.size() > 1) {
--- a/OrthancServer/Sources/Search/DatabaseDicomTagConstraints.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Search/DatabaseDicomTagConstraints.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -121,7 +121,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } s += "\n";
--- a/OrthancServer/Sources/Search/DicomTagConstraint.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Search/DicomTagConstraint.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -218,7 +218,7 @@ } else if (values_.size() != 1) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -304,7 +304,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -376,7 +376,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -400,7 +400,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::vector<std::string> values;
--- a/OrthancServer/Sources/Search/HierarchicalMatcher.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Search/HierarchicalMatcher.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -72,7 +72,7 @@ DcmElement* element = dataset.getElement(i); if (element == NULL) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DicomTag tag(FromDcmtkBridge::Convert(element->getTag()));
--- a/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/Search/ISqlLookupFormatter.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -54,7 +54,7 @@ return "instances"; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -75,7 +75,7 @@ return std::string(prefix) + "instances"; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -112,7 +112,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::string parameter = formatter.GenerateParameter(constraint.GetSingleValue()); @@ -440,7 +440,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::string parameter = formatter.GenerateParameter(constraint.GetSingleValue()); @@ -760,7 +760,7 @@ FormatJoinForOrdering(orderingJoin, (*it)->GetMetadataType(), counter, request.GetLevel()); break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } orderingJoins += orderingJoin;
--- a/OrthancServer/Sources/ServerContext.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerContext.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -1831,7 +1831,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1843,7 +1843,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1896,7 +1896,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } Json::Value dicomAsJson; @@ -1976,7 +1976,7 @@ } }; break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } }
--- a/OrthancServer/Sources/ServerIndex.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerIndex.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -541,7 +541,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } catch (OrthancException& e)
--- a/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -226,7 +226,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -244,7 +244,7 @@ if (level > level_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } switch (level) @@ -262,7 +262,7 @@ return instance_; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } }; @@ -756,7 +756,7 @@ } default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -1176,7 +1176,7 @@ if (asynchronousTarget_.get() != NULL) { // It is up to this method to create the asynchronous target - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else {
--- a/OrthancServer/Sources/ServerJobs/CleaningInstancesJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/CleaningInstancesJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -69,7 +69,7 @@ if (!HasTrailingStep()) { // Should have been set by (*) - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (serialized.isMember(KEEP_SOURCE))
--- a/OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -77,7 +77,7 @@ if (sopClassUids_.size() != sopInstanceUids_.size() || sopClassUids_.size() > GetInstancesCount()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (sopClassUids_.size() == GetInstancesCount()) @@ -109,7 +109,7 @@ bool DicomModalityStoreJob::HandleTrailingStep() { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); }
--- a/OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -378,7 +378,7 @@ if (!HasTrailingStep()) { // Should have been set by (*) - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } targetStudy_ = SerializationToolbox::ReadString(serialized, TARGET_STUDY);
--- a/OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/Operations/ModifyInstanceOperation.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -67,7 +67,7 @@ if (origin_ != RequestOrigin_Lua) { // TODO If issued from HTTP, "remoteIp" and "username" must be provided - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } }
--- a/OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -133,7 +133,7 @@ bool OrthancPeerStoreJob::HandleTrailingStep() { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); }
--- a/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -86,7 +86,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } patientId_ = hasher.HashPatient(); @@ -280,7 +280,7 @@ !modified->GetDcmtkObject().getDataset()->putAndInsertString( DCM_SOPInstanceUID, modifiedUid.c_str(), OFTrue /* replace */).good()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } else
--- a/OrthancServer/Sources/ServerJobs/SplitStudyJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/SplitStudyJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -337,7 +337,7 @@ if (!HasTrailingStep()) { // Should have been set by (*) - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } Setup();
--- a/OrthancServer/Sources/ServerJobs/StorageCommitmentScpJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/StorageCommitmentScpJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -221,7 +221,7 @@ if (n <= 1) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } for (size_t i = 0; i < n; i++) @@ -232,7 +232,7 @@ (i >= 1 && i < n - 1 && type != CommandType_Lookup) || (i == n - 1 && type != CommandType_Answer)) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (type == CommandType_Lookup) @@ -240,7 +240,7 @@ const LookupCommand& lookup = dynamic_cast<const LookupCommand&>(GetCommand(i)); if (lookup.GetIndex() != i - 1) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } } @@ -264,7 +264,7 @@ if (index >= sopClassUids_.size()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else if (lookupHandler_.get() != NULL) { @@ -339,7 +339,7 @@ if (failureReasons.size() != sopClassUids_.size()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } DicomAssociationParameters parameters(connection_->GetCalledAet(), remoteModality_);
--- a/OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -141,7 +141,7 @@ if (!started_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (GetInstancesCount() == 0)
--- a/OrthancServer/Sources/ServerTranscoder.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/ServerTranscoder.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -29,6 +29,7 @@ #include "../../OrthancFramework/Sources/DataSource/StorageAreaDataSource.h" #include "../../OrthancFramework/Sources/DataSource/TranscoderDataSource.h" #include "../../OrthancFramework/Sources/DicomParsing/DcmtkTranscoder.h" +#include "../../OrthancFramework/Sources/DicomFormat/DicomImageInformation.h" #include "../../OrthancFramework/Sources/Logging.h" #include "../../OrthancFramework/Sources/OrthancException.h" #include "../Plugins/Engine/OrthancPlugins.h" @@ -292,6 +293,14 @@ ImageAccessor* ServerTranscoder::DecodeFrame(const DicomInstanceToStore& image, unsigned int frameIndex) { + { // check that the target image has a valid/reasonable size before decoding to avoid possible crash or OOB during transcoding + DicomMap summary; + image.GetSummary(summary); + + DicomImageInformation imageInfo(summary); + imageInfo.ThrowIfInvalidFrameSize(); + } + std::unique_ptr<ImageAccessor> decoded; if (builtinDecoderTranscoderOrder_ == BuiltinDecoderTranscoderOrder_Before)
--- a/OrthancServer/Sources/StorageCommitmentReports.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/StorageCommitmentReports.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -128,7 +128,7 @@ break; default: - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } if (!pending)
--- a/OrthancServer/Sources/main.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/Sources/main.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -139,7 +139,7 @@ { if (referencedSopClassUids.size() != referencedSopInstanceUids.size()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::unique_ptr<StorageCommitmentScpJob> job( @@ -167,7 +167,7 @@ failedSopClassUids.size() != failedSopInstanceUids.size() || failedSopClassUids.size() != failureReasons.size()) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } std::unique_ptr<StorageCommitmentReports::Report> report(
--- a/OrthancServer/UnitTestsSources/ServerIndexTests.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/UnitTestsSources/ServerIndexTests.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -231,18 +231,18 @@ virtual void SignalRemainingAncestor(ResourceType parentType, const std::string& publicId) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual void SignalAttachmentDeleted(const FileInfo& info) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual void SignalResourceDeleted(ResourceType type, const std::string& publicId) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual void Commit() ORTHANC_OVERRIDE @@ -257,30 +257,30 @@ virtual bool IsUnstableResource(Orthanc::ResourceType type, int64_t id) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual bool LookupRemainingLevel(std::string& remainingPublicId /* out */, ResourceType& remainingLevel /* out */) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual void MarkAsUnstable(Orthanc::ResourceType type, int64_t id, const std::string& publicId) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual void SignalAttachmentsAdded(uint64_t compressedSize) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual void SignalChange(const ServerIndexChange& change) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } };
--- a/OrthancServer/UnitTestsSources/ServerJobsTests.cpp Wed Jun 03 18:17:50 2026 +0200 +++ b/OrthancServer/UnitTestsSources/ServerJobsTests.cpp Fri Jun 05 11:28:32 2026 +0200 @@ -145,7 +145,7 @@ virtual void SetUserData(const Json::Value& userData) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual bool GetUserData(Json::Value& userData) const ORTHANC_OVERRIDE @@ -175,7 +175,7 @@ { if (trailingStepDone_) { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } else { @@ -185,7 +185,7 @@ } else { - throw OrthancException(ErrorCode_InternalError); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_InternalError); } } @@ -224,7 +224,7 @@ virtual void SetUserData(const Json::Value& userData) ORTHANC_OVERRIDE { - throw OrthancException(ErrorCode_NotImplemented); + THROW_WITH_FILE_AND_LINE_INFO(ErrorCode_NotImplemented); } virtual bool GetUserData(Json::Value& userData) const ORTHANC_OVERRIDE
