diff Plugins/Engine/PluginsErrorDictionary.cpp @ 1651:2e692c83e2f3

improved custom error login
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Sep 2015 17:29:39 +0200
parents 9f34ebfaf2c9
children b1291df2f780
line wrap: on
line diff
--- a/Plugins/Engine/PluginsErrorDictionary.cpp	Fri Sep 25 16:47:05 2015 +0200
+++ b/Plugins/Engine/PluginsErrorDictionary.cpp	Fri Sep 25 17:29:39 2015 +0200
@@ -88,12 +88,13 @@
   }
 
 
-  void  PluginsErrorDictionary::LogError(const OrthancException& exception)
+  void  PluginsErrorDictionary::LogError(ErrorCode code,
+                                         bool ignoreBuiltinErrors)
   {
-    if (exception.GetErrorCode() >= ErrorCode_START_PLUGINS)
+    if (code >= ErrorCode_START_PLUGINS)
     {
       boost::mutex::scoped_lock lock(mutex_);
-      Errors::const_iterator error = errors_.find(static_cast<int32_t>(exception.GetErrorCode()));
+      Errors::const_iterator error = errors_.find(static_cast<int32_t>(code));
       
       if (error != errors_.end())
       {
@@ -104,7 +105,11 @@
       }
     }
 
-    LOG(ERROR) << "Exception inside the plugin engine: " << exception.What();
+    if (!ignoreBuiltinErrors)
+    {
+      LOG(ERROR) << "Exception inside the plugin engine: "
+                 << EnumerationToString(code);
+    }
   }