Mercurial > hg > orthanc
changeset 1570:2bd2c280f9b5
fix indentation
author | jodogne |
---|---|
date | Sun, 23 Aug 2015 11:13:03 +0200 |
parents | 27774f6f84e4 |
children | 3232f1c995a5 |
files | Core/HttpServer/MongooseServer.cpp OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp |
diffstat | 2 files changed, 44 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/HttpServer/MongooseServer.cpp Sun Aug 23 11:01:15 2015 +0200 +++ b/Core/HttpServer/MongooseServer.cpp Sun Aug 23 11:13:03 2015 +0200 @@ -725,26 +725,26 @@ bool found = false; try - { - if (that->HasHandler()) - { - found = that->GetHandler().Handle(output, method, uri, headers, argumentsGET, body.c_str(), body.size()); - } - } + { + if (that->HasHandler()) + { + found = that->GetHandler().Handle(output, method, uri, headers, argumentsGET, body.c_str(), body.size()); + } + } catch (boost::bad_lexical_cast&) - { - throw OrthancException(ErrorCode_BadParameterType); - } + { + throw OrthancException(ErrorCode_BadParameterType); + } catch (std::runtime_error&) - { - // Presumably an error while parsing the JSON body - throw OrthancException(ErrorCode_BadRequest); - } + { + // Presumably an error while parsing the JSON body + throw OrthancException(ErrorCode_BadRequest); + } if (!found) - { - throw OrthancException(ErrorCode_UnknownResource); - } + { + throw OrthancException(ErrorCode_UnknownResource); + } } catch (OrthancException& e) { @@ -757,15 +757,15 @@ { switch (e.GetErrorCode()) { - case ErrorCode_InexistentFile: - case ErrorCode_InexistentItem: - case ErrorCode_UnknownResource: - status = HttpStatus_404_NotFound; - break; + case ErrorCode_InexistentFile: + case ErrorCode_InexistentItem: + case ErrorCode_UnknownResource: + status = HttpStatus_404_NotFound; + break; - case ErrorCode_BadRequest: - case ErrorCode_UriSyntax: - case ErrorCode_BadParameterType: + case ErrorCode_BadRequest: + case ErrorCode_UriSyntax: + case ErrorCode_BadParameterType: status = HttpStatus_400_BadRequest; break;
--- a/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp Sun Aug 23 11:01:15 2015 +0200 +++ b/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp Sun Aug 23 11:13:03 2015 +0200 @@ -555,9 +555,9 @@ payload = &content[i]["Content"]; if (content[i].isMember("Tags")) - { - InjectTags(*dicom, content[i]["Tags"]); - } + { + InjectTags(*dicom, content[i]["Tags"]); + } } if (payload == NULL || @@ -579,10 +579,10 @@ std::string series; if (context.GetIndex().LookupParent(series, someInstance)) - { + { Json::Value dummy; context.GetIndex().DeleteResource(dummy, series, ResourceType_Series); - } + } throw e; } @@ -797,25 +797,25 @@ Json::Value request; if (!call.ParseJsonRequest(request) || !request.isObject()) - { - throw OrthancException(ErrorCode_BadRequest); - } + { + throw OrthancException(ErrorCode_BadRequest); + } if (request.isMember("Tags")) - { - CreateDicomV2(call, request); - } + { + CreateDicomV2(call, request); + } else - { - // Compatibility with Orthanc <= 0.9.3 - ServerContext& context = OrthancRestApi::GetContext(call); - ParsedDicomFile dicom; - CreateDicomV1(dicom, request); + { + // Compatibility with Orthanc <= 0.9.3 + ServerContext& context = OrthancRestApi::GetContext(call); + ParsedDicomFile dicom; + CreateDicomV1(dicom, request); - std::string id; - StoreCreatedInstance(id, context, dicom); - OrthancRestApi::GetApi(call).AnswerStoredResource(call, id, ResourceType_Instance, StoreStatus_Success); - } + std::string id; + StoreCreatedInstance(id, context, dicom); + OrthancRestApi::GetApi(call).AnswerStoredResource(call, id, ResourceType_Instance, StoreStatus_Success); + } }