comparison OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 2955:bbfd95a0c429

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Dec 2018 14:59:23 +0100
parents 4767d36679ed
children 0a52af0c66e7
comparison
equal deleted inserted replaced
2954:d924f9bb61cc 2955:bbfd95a0c429
149 if (call.HasArgument("limit") || 149 if (call.HasArgument("limit") ||
150 call.HasArgument("since")) 150 call.HasArgument("since"))
151 { 151 {
152 if (!call.HasArgument("limit")) 152 if (!call.HasArgument("limit"))
153 { 153 {
154 LOG(ERROR) << "Missing \"limit\" argument for GET request against: " << call.FlattenUri(); 154 throw OrthancException(ErrorCode_BadRequest,
155 throw OrthancException(ErrorCode_BadRequest); 155 "Missing \"limit\" argument for GET request against: " +
156 call.FlattenUri());
156 } 157 }
157 158
158 if (!call.HasArgument("since")) 159 if (!call.HasArgument("since"))
159 { 160 {
160 LOG(ERROR) << "Missing \"since\" argument for GET request against: " << call.FlattenUri(); 161 throw OrthancException(ErrorCode_BadRequest,
161 throw OrthancException(ErrorCode_BadRequest); 162 "Missing \"since\" argument for GET request against: " +
163 call.FlattenUri());
162 } 164 }
163 165
164 size_t since = boost::lexical_cast<size_t>(call.GetArgument("since", "")); 166 size_t since = boost::lexical_cast<size_t>(call.GetArgument("since", ""));
165 size_t limit = boost::lexical_cast<size_t>(call.GetArgument("limit", "")); 167 size_t limit = boost::lexical_cast<size_t>(call.GetArgument("limit", ""));
166 index.GetAllUuids(result, resourceType, since, limit); 168 index.GetAllUuids(result, resourceType, since, limit);
438 { 440 {
439 } 441 }
440 442
441 if (!ok) 443 if (!ok)
442 { 444 {
443 LOG(ERROR) << "Bad quality for a JPEG encoding (must be a number between 0 and 100): " << v; 445 throw OrthancException(
444 throw OrthancException(ErrorCode_BadRequest); 446 ErrorCode_BadRequest,
447 "Bad quality for a JPEG encoding (must be a number between 0 and 100): " + v);
445 } 448 }
446 } 449 }
447 450
448 virtual void Handle(const std::string& type, 451 virtual void Handle(const std::string& type,
449 const std::string& subtype) 452 const std::string& subtype)