Mercurial > hg > orthanc
changeset 6313:a84bf2926cc3
DimseErrorStatus in C-Move
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Thu, 18 Sep 2025 12:36:41 +0200 |
parents | 6ce5e7b44afc |
children | 1b8bea570a80 |
files | NEWS OrthancFramework/Sources/OrthancException.cpp OrthancFramework/Sources/OrthancException.h |
diffstat | 3 files changed, 30 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Thu Sep 18 10:05:21 2025 +0200 +++ b/NEWS Thu Sep 18 12:36:41 2025 +0200 @@ -11,8 +11,10 @@ REST API -------- -* C-Store and C-Get jobs and HTTP responses now include a new "DimseErrorStatus" field if - the operation fails. +* Fix: C-Get SCU jobs or HTTP responses were always successfull even if the C-Get operation + actually failed. +* C-Store, C-Move and C-Get jobs and HTTP responses now include a new "DimseErrorStatus" + field if the operation fails. Maintenance
--- a/OrthancFramework/Sources/OrthancException.cpp Thu Sep 18 10:05:21 2025 +0200 +++ b/OrthancFramework/Sources/OrthancException.cpp Thu Sep 18 12:36:41 2025 +0200 @@ -102,6 +102,26 @@ OrthancException::OrthancException(ErrorCode errorCode, HttpStatus httpStatus, const std::string& details, + uint16_t dimseErrorStatus, + bool log) : + errorCode_(errorCode), + httpStatus_(httpStatus), + logged_(log), + details_(new std::string(details)), + hasDimseErrorStatus_(true), + dimseErrorStatus_(dimseErrorStatus) + { +#if ORTHANC_ENABLE_LOGGING == 1 + if (log) + { + LOG(ERROR) << EnumerationToString(errorCode_) << ": " << details; + } +#endif + } + + OrthancException::OrthancException(ErrorCode errorCode, + HttpStatus httpStatus, + const std::string& details, bool log) : errorCode_(errorCode), httpStatus_(httpStatus),
--- a/OrthancFramework/Sources/OrthancException.h Thu Sep 18 10:05:21 2025 +0200 +++ b/OrthancFramework/Sources/OrthancException.h Thu Sep 18 12:36:41 2025 +0200 @@ -70,6 +70,12 @@ const std::string& details, bool log = true); + OrthancException(ErrorCode errorCode, + HttpStatus httpStatus, + const std::string& details, + uint16_t dimseErrorStatus, + bool log = true); + ErrorCode GetErrorCode() const; HttpStatus GetHttpStatus() const;