Mercurial > hg > orthanc
comparison Plugins/Engine/OrthancPlugins.cpp @ 1984:9f09a20e41e2
corrected error code
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 25 Apr 2016 14:31:19 +0200 |
parents | 22ddb22fce83 |
children | ce90d109bb64 |
comparison
equal
deleted
inserted
replaced
1983:0af087300b26 | 1984:9f09a20e41e2 |
---|---|
960 { | 960 { |
961 CopyToMemoryBuffer(*p.target, result); | 961 CopyToMemoryBuffer(*p.target, result); |
962 } | 962 } |
963 else | 963 else |
964 { | 964 { |
965 throw OrthancException(ErrorCode_BadRequest); | 965 throw OrthancException(ErrorCode_UnknownResource); |
966 } | 966 } |
967 } | 967 } |
968 | 968 |
969 | 969 |
970 void OrthancPlugins::RestApiGet2(const void* parameters) | 970 void OrthancPlugins::RestApiGet2(const void* parameters) |
992 { | 992 { |
993 CopyToMemoryBuffer(*p.target, result); | 993 CopyToMemoryBuffer(*p.target, result); |
994 } | 994 } |
995 else | 995 else |
996 { | 996 { |
997 throw OrthancException(ErrorCode_BadRequest); | 997 throw OrthancException(ErrorCode_UnknownResource); |
998 } | 998 } |
999 } | 999 } |
1000 | 1000 |
1001 | 1001 |
1002 void OrthancPlugins::RestApiPostPut(bool isPost, | 1002 void OrthancPlugins::RestApiPostPut(bool isPost, |
1019 { | 1019 { |
1020 CopyToMemoryBuffer(*p.target, result); | 1020 CopyToMemoryBuffer(*p.target, result); |
1021 } | 1021 } |
1022 else | 1022 else |
1023 { | 1023 { |
1024 throw OrthancException(ErrorCode_BadRequest); | 1024 throw OrthancException(ErrorCode_UnknownResource); |
1025 } | 1025 } |
1026 } | 1026 } |
1027 | 1027 |
1028 | 1028 |
1029 void OrthancPlugins::RestApiDelete(const void* parameters, | 1029 void OrthancPlugins::RestApiDelete(const void* parameters, |
1036 CheckContextAvailable(); | 1036 CheckContextAvailable(); |
1037 IHttpHandler& handler = pimpl_->context_->GetHttpHandler().RestrictToOrthancRestApi(!afterPlugins); | 1037 IHttpHandler& handler = pimpl_->context_->GetHttpHandler().RestrictToOrthancRestApi(!afterPlugins); |
1038 | 1038 |
1039 if (!HttpToolbox::SimpleDelete(handler, RequestOrigin_Plugins, uri)) | 1039 if (!HttpToolbox::SimpleDelete(handler, RequestOrigin_Plugins, uri)) |
1040 { | 1040 { |
1041 throw OrthancException(ErrorCode_BadRequest); | 1041 throw OrthancException(ErrorCode_UnknownResource); |
1042 } | 1042 } |
1043 } | 1043 } |
1044 | 1044 |
1045 | 1045 |
1046 void OrthancPlugins::LookupResource(_OrthancPluginService service, | 1046 void OrthancPlugins::LookupResource(_OrthancPluginService service, |