comparison OrthancServer/ServerJobs/ResourceModificationJob.cpp @ 2955:bbfd95a0c429

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Dec 2018 14:59:23 +0100
parents abce036683cd
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2954:d924f9bb61cc 2955:bbfd95a0c429
132 bool ResourceModificationJob::HandleInstance(const std::string& instance) 132 bool ResourceModificationJob::HandleInstance(const std::string& instance)
133 { 133 {
134 if (modification_.get() == NULL || 134 if (modification_.get() == NULL ||
135 output_.get() == NULL) 135 output_.get() == NULL)
136 { 136 {
137 LOG(ERROR) << "No modification was provided for this job"; 137 throw OrthancException(ErrorCode_BadSequenceOfCalls,
138 throw OrthancException(ErrorCode_BadSequenceOfCalls); 138 "No modification was provided for this job");
139 } 139 }
140 140
141 141
142 LOG(INFO) << "Modifying instance in a job: " << instance; 142 LOG(INFO) << "Modifying instance in a job: " << instance;
143 143
210 **/ 210 **/
211 211
212 std::string modifiedInstance; 212 std::string modifiedInstance;
213 if (context_.Store(modifiedInstance, toStore) != StoreStatus_Success) 213 if (context_.Store(modifiedInstance, toStore) != StoreStatus_Success)
214 { 214 {
215 LOG(ERROR) << "Error while storing a modified instance " << instance; 215 throw OrthancException(ErrorCode_CannotStoreInstance,
216 throw OrthancException(ErrorCode_CannotStoreInstance); 216 "Error while storing a modified instance " + instance);
217 } 217 }
218 218
219 assert(modifiedInstance == modifiedHasher.HashInstance()); 219 assert(modifiedInstance == modifiedHasher.HashInstance());
220 220
221 output_->Update(modifiedHasher); 221 output_->Update(modifiedHasher);