diff Plugins/Engine/OrthancPlugins.cpp @ 1649:8040d56cb0b3

New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Sep 2015 16:24:13 +0200
parents da799f767e5d
children 2e692c83e2f3
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPlugins.cpp	Fri Sep 25 11:33:55 2015 +0200
+++ b/Plugins/Engine/OrthancPlugins.cpp	Fri Sep 25 16:24:13 2015 +0200
@@ -1674,6 +1674,14 @@
         return true;
       }
 
+      case _OrthancPluginService_RegisterErrorCode:
+      {
+        const _OrthancPluginRegisterErrorCode& p =
+          *reinterpret_cast<const _OrthancPluginRegisterErrorCode*>(parameters);
+        *(p.target) = pimpl_->dictionary_.Register(plugin, p.code, p.httpStatus, p.message);
+        return true;
+      }
+
       default:
       {
         // This service is unknown to the Orthanc plugin engine