diff Plugins/Engine/OrthancPlugins.cpp @ 1643:87c77b9b3679

provision for error codes in plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Sep 2015 14:42:20 +0200
parents eb8fbcf008b5
children 939b921b2c81
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPlugins.cpp	Wed Sep 23 13:39:00 2015 +0200
+++ b/Plugins/Engine/OrthancPlugins.cpp	Wed Sep 23 14:42:20 2015 +0200
@@ -118,7 +118,7 @@
         catch (...)
         {
           Free(buffer);
-          throw;
+          throw OrthancException(ErrorCode_NotEnoughMemory);
         }
 
         if (size > 0)
@@ -743,8 +743,7 @@
   {
     if (!pimpl_->context_)
     {
-      LOG(ERROR) << "Plugin trying to call the database during its initialization";
-      throw OrthancException(ErrorCode_Plugin);
+      throw OrthancException(ErrorCode_DatabaseNotInitialized);
     }
   }