comparison Plugins/Samples/Common/OrthancPluginCppWrapper.h @ 2177:11420238f337

ORTHANC_PLUGINS_THROW_EXCEPTION macro
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Nov 2016 12:29:28 +0100
parents fead5549aaa7
children 1d0838b8e9c5
comparison
equal deleted inserted replaced
2176:fead5549aaa7 2177:11420238f337
42 #endif 42 #endif
43 43
44 44
45 #if HAS_ORTHANC_EXCEPTION == 1 45 #if HAS_ORTHANC_EXCEPTION == 1
46 # include "../../../Core/OrthancException.h" 46 # include "../../../Core/OrthancException.h"
47 # define ORTHANC_PLUGINS_THROW_EXCEPTION(code) throw ::Orthanc::OrthancException(static_cast<Orthanc::ErrorCode>(code))
48 #else
49 # define ORTHANC_PLUGINS_THROW_EXCEPTION(code) throw ::OrthancPlugins::PluginException(code)
47 #endif 50 #endif
51
48 52
49 53
50 namespace OrthancPlugins 54 namespace OrthancPlugins
51 { 55 {
52 typedef void (*RestCallback) (OrthancPluginRestOutput* output, 56 typedef void (*RestCallback) (OrthancPluginRestOutput* output,
53 const char* url, 57 const char* url,
54 const OrthancPluginHttpRequest* request); 58 const OrthancPluginHttpRequest* request);
55 59
56 const char* GetErrorDescription(OrthancPluginContext* context, 60 const char* GetErrorDescription(OrthancPluginContext* context,
57 OrthancPluginErrorCode code); 61 OrthancPluginErrorCode code);
58
59 void ThrowException(OrthancPluginErrorCode code);
60 62
61 #if HAS_ORTHANC_EXCEPTION == 0 63 #if HAS_ORTHANC_EXCEPTION == 0
62 class PluginException 64 class PluginException
63 { 65 {
64 private: 66 private: