comparison Plugins/Samples/Common/OrthancPluginException.h @ 2239:15637de71fee

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 16 Dec 2016 17:01:33 +0100
parents a78d15509a1c
children a3a65de1840f
comparison
equal deleted inserted replaced
2238:4f0a9a61d905 2239:15637de71fee
37 #endif 37 #endif
38 38
39 39
40 #if HAS_ORTHANC_EXCEPTION == 1 40 #if HAS_ORTHANC_EXCEPTION == 1
41 # include "../../../Core/OrthancException.h" 41 # include "../../../Core/OrthancException.h"
42 # define ORTHANC_PLUGINS_GET_ERROR_ENUMERATION ::Orthanc::ErrorCode 42 # define ORTHANC_PLUGINS_ERROR_ENUMERATION ::Orthanc::ErrorCode
43 # define ORTHANC_PLUGINS_GET_ERROR_CODE(code) ::Orthanc::ErrorCode_ ## code 43 # define ORTHANC_PLUGINS_EXCEPTION_CLASS ::Orthanc::OrthancException
44 # define ORTHANC_PLUGINS_GET_EXCEPTION_CLASS ::Orthanc::OrthancException 44 # define ORTHANC_PLUGINS_GET_ERROR_CODE(code) ::Orthanc::ErrorCode_ ## code
45 #else 45 #else
46 # include <orthanc/OrthancCPlugin.h> 46 # include <orthanc/OrthancCPlugin.h>
47 # define ORTHANC_PLUGINS_GET_ERROR_ENUMERATION ::OrthancPluginErrorCode 47 # define ORTHANC_PLUGINS_ERROR_ENUMERATION ::OrthancPluginErrorCode
48 # define ORTHANC_PLUGINS_GET_ERROR_CODE(code) ::OrthancPluginErrorCode_ ## code 48 # define ORTHANC_PLUGINS_EXCEPTION_CLASS ::OrthancPlugins::PluginException
49 # define ORTHANC_PLUGINS_GET_EXCEPTION_CLASS ::OrthancPlugins::PluginException 49 # define ORTHANC_PLUGINS_GET_ERROR_CODE(code) ::OrthancPluginErrorCode_ ## code
50 #endif 50 #endif
51 51
52 52
53 #define ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code) \ 53 #define ORTHANC_PLUGINS_THROW_PLUGIN_ERROR_CODE(code) \
54 throw ORTHANC_PLUGINS_GET_EXCEPTION_CLASS(static_cast<ORTHANC_PLUGINS_GET_ERROR_ENUMERATION>(code)); 54 throw ORTHANC_PLUGINS_EXCEPTION_CLASS(static_cast<ORTHANC_PLUGINS_ERROR_ENUMERATION>(code));
55 55
56 56
57 #define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \ 57 #define ORTHANC_PLUGINS_THROW_EXCEPTION(code) \
58 throw ORTHANC_PLUGINS_GET_EXCEPTION_CLASS(ORTHANC_PLUGINS_GET_ERROR_CODE(code)); 58 throw ORTHANC_PLUGINS_EXCEPTION_CLASS(ORTHANC_PLUGINS_GET_ERROR_CODE(code));
59 59
60 60
61 #define ORTHANC_PLUGINS_CHECK_ERROR(code) \ 61 #define ORTHANC_PLUGINS_CHECK_ERROR(code) \
62 if (code != ORTHANC_PLUGINS_GET_ERROR_CODE(Success)) \ 62 if (code != ORTHANC_PLUGINS_GET_ERROR_CODE(Success)) \
63 { \ 63 { \