Mercurial > hg > orthanc
comparison Core/OrthancException.h @ 2954:d924f9bb61cc
taking advantage of details in OrthancException
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 03 Dec 2018 14:35:34 +0100 |
parents | 4ceb9bf7b00c |
children | 74a5a7fd6e0e |
comparison
equal
deleted
inserted
replaced
2953:210d5afd8f2b | 2954:d924f9bb61cc |
---|---|
76 const std::string& details) : | 76 const std::string& details) : |
77 errorCode_(errorCode), | 77 errorCode_(errorCode), |
78 httpStatus_(ConvertErrorCodeToHttpStatus(errorCode)), | 78 httpStatus_(ConvertErrorCodeToHttpStatus(errorCode)), |
79 details_(new std::string(details)) | 79 details_(new std::string(details)) |
80 { | 80 { |
81 #if ORTHANC_ENABLE_LOGGING == 1 | |
81 LOG(ERROR) << EnumerationToString(errorCode_) << ": " << details; | 82 LOG(ERROR) << EnumerationToString(errorCode_) << ": " << details; |
83 #endif | |
82 } | 84 } |
83 | 85 |
84 OrthancException(ErrorCode errorCode, | 86 OrthancException(ErrorCode errorCode, |
85 HttpStatus httpStatus) : | 87 HttpStatus httpStatus) : |
86 errorCode_(errorCode), | 88 errorCode_(errorCode), |
93 const std::string& details) : | 95 const std::string& details) : |
94 errorCode_(errorCode), | 96 errorCode_(errorCode), |
95 httpStatus_(httpStatus), | 97 httpStatus_(httpStatus), |
96 details_(new std::string(details)) | 98 details_(new std::string(details)) |
97 { | 99 { |
100 #if ORTHANC_ENABLE_LOGGING == 1 | |
98 LOG(ERROR) << EnumerationToString(errorCode_) << ": " << details; | 101 LOG(ERROR) << EnumerationToString(errorCode_) << ": " << details; |
102 #endif | |
99 } | 103 } |
100 | 104 |
101 ErrorCode GetErrorCode() const | 105 ErrorCode GetErrorCode() const |
102 { | 106 { |
103 return errorCode_; | 107 return errorCode_; |