Mercurial > hg > orthanc
diff OrthancServer/ServerJobs/MergeStudyJob.cpp @ 2955:bbfd95a0c429
cont
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 03 Dec 2018 14:59:23 +0100 |
parents | 8b00e4cb4a6b |
children | 4e43e67f8ecf |
line wrap: on
line diff
--- a/OrthancServer/ServerJobs/MergeStudyJob.cpp Mon Dec 03 14:35:34 2018 +0100 +++ b/OrthancServer/ServerJobs/MergeStudyJob.cpp Mon Dec 03 14:59:23 2018 +0100 @@ -61,8 +61,8 @@ { if (study == targetStudy_) { - LOG(ERROR) << "Cannot merge a study into the same study: " << study; - throw OrthancException(ErrorCode_UnknownResource); + throw OrthancException(ErrorCode_UnknownResource, + "Cannot merge a study into the same study: " + study); } else { @@ -183,8 +183,8 @@ if (!context_.GetIndex().LookupResourceType(type, targetStudy) || type != ResourceType_Study) { - LOG(ERROR) << "Cannot merge into an unknown study: " << targetStudy; - throw OrthancException(ErrorCode_UnknownResource); + throw OrthancException(ErrorCode_UnknownResource, + "Cannot merge into an unknown study: " + targetStudy); } @@ -257,8 +257,8 @@ } else if (!context_.GetIndex().LookupResourceType(level, studyOrSeries)) { - LOG(ERROR) << "Cannot find this resource: " << studyOrSeries; - throw OrthancException(ErrorCode_UnknownResource); + throw OrthancException(ErrorCode_UnknownResource, + "Cannot find this resource: " + studyOrSeries); } else { @@ -273,9 +273,10 @@ break; default: - LOG(ERROR) << "This resource is neither a study, nor a series: " - << studyOrSeries << " is a " << EnumerationToString(level); - throw OrthancException(ErrorCode_UnknownResource); + throw OrthancException(ErrorCode_UnknownResource, + "This resource is neither a study, nor a series: " + + studyOrSeries + " is a " + + std::string(EnumerationToString(level))); } } } @@ -291,14 +292,14 @@ } else if (!context_.GetIndex().LookupParent(parent, series, ResourceType_Study)) { - LOG(ERROR) << "This resource is not a series: " << series; - throw OrthancException(ErrorCode_UnknownResource); + throw OrthancException(ErrorCode_UnknownResource, + "This resource is not a series: " + series); } else if (parent == targetStudy_) { - LOG(ERROR) << "Cannot merge series " << series - << " into its parent study " << targetStudy_; - throw OrthancException(ErrorCode_UnknownResource); + throw OrthancException(ErrorCode_UnknownResource, + "Cannot merge series " + series + + " into its parent study " + targetStudy_); } else { @@ -318,8 +319,8 @@ else if (!context_.GetIndex().LookupResourceType(actualLevel, study) || actualLevel != ResourceType_Study) { - LOG(ERROR) << "This resource is not a study: " << study; - throw OrthancException(ErrorCode_UnknownResource); + throw OrthancException(ErrorCode_UnknownResource, + "This resource is not a study: " + study); } else {