# HG changeset patch # User Sebastien Jodogne # Date 1447319779 -3600 # Node ID 73b9a82670e39dcb0811fc35c794073f68da3d23 # Parent 3cc0c30da5ead90e051b61299b4ff5e72415fbff better error reporting diff -r 3cc0c30da5ea -r 73b9a82670e3 Plugin/Configuration.h --- a/Plugin/Configuration.h Mon Nov 09 09:38:15 2015 +0100 +++ b/Plugin/Configuration.h Thu Nov 12 10:16:19 2015 +0100 @@ -27,10 +27,12 @@ # define REST_RETURN_TYPE int32_t # define REST_RETURN_SUCCESS 0 # define REST_RETURN_FAILURE -1 +# define HAS_ERROR_CODE 0 #else # define REST_RETURN_TYPE OrthancPluginErrorCode # define REST_RETURN_SUCCESS OrthancPluginErrorCode_Success # define REST_RETURN_FAILURE OrthancPluginErrorCode_Plugin +# define HAS_ERROR_CODE 1 #endif diff -r 3cc0c30da5ea -r 73b9a82670e3 Plugin/Wado.cpp --- a/Plugin/Wado.cpp Mon Nov 09 09:38:15 2015 +0100 +++ b/Plugin/Wado.cpp Thu Nov 12 10:16:19 2015 +0100 @@ -249,7 +249,11 @@ std::string contentType = "image/jpg"; // By default, JPEG image will be returned if (!LocateInstance(instance, contentType, request)) { +#if HAS_ERROR_CODE == 1 + return OrthancPluginErrorCode_UnknownResource; +#else return REST_RETURN_FAILURE; +#endif } if (contentType == "application/dicom")