diff Sources/PythonLock.cpp @ 75:cbfc72a53970

refactoring calls to PythonLock::RaiseException()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 09 Aug 2021 16:59:59 +0200
parents 32de70a1e4c7
children e7ff5efb100d
line wrap: on
line diff
--- a/Sources/PythonLock.cpp	Sat Jun 12 08:00:57 2021 +0200
+++ b/Sources/PythonLock.cpp	Mon Aug 09 16:59:59 2021 +0200
@@ -472,11 +472,13 @@
 }
 
 
-void PythonLock::RaiseException(PyObject* module,
-                                OrthancPluginErrorCode code)
+void PythonLock::RaiseException(OrthancPluginErrorCode code)
 {
   if (code != OrthancPluginErrorCode_Success)
   {
+    PyErr_SetString(PyExc_ValueError, "Internal error");
+    
+#if 0
     const char* message = OrthancPluginGetErrorDescription(OrthancPlugins::GetGlobalContext(), code);
     
     struct module_state *state = GETSTATE(module);
@@ -488,6 +490,7 @@
     {
       PyErr_SetString(state->exceptionClass_, message);
     }
+#endif
   }
 }