# HG changeset patch # User jodogne # Date 1440321183 -7200 # Node ID 2bd2c280f9b500dea31decf338995e54c0ea2f8a # Parent 27774f6f84e44e6db4584eec3767148258aa5f3b fix indentation diff -r 27774f6f84e4 -r 2bd2c280f9b5 Core/HttpServer/MongooseServer.cpp --- 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; diff -r 27774f6f84e4 -r 2bd2c280f9b5 OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp --- 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); + } }