comparison Sources/Autogenerated/sdk_OrthancPluginJob.impl.h @ 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 eb6ac5a801d1
comparison
equal deleted inserted replaced
73:da73be4b361b 75:cbfc72a53970
95 { 95 {
96 PythonLock::LogCall("Calling method OrthancPluginSubmitJob() on object of class OrthancPluginJob"); 96 PythonLock::LogCall("Calling method OrthancPluginSubmitJob() on object of class OrthancPluginJob");
97 97
98 if (self->object_ == NULL) 98 if (self->object_ == NULL)
99 { 99 {
100 // TODO: RAISE
101 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
102 PyErr_SetString(PyExc_ValueError, "Invalid object"); 100 PyErr_SetString(PyExc_ValueError, "Invalid object");
103 return NULL; 101 return NULL;
104 } 102 }
105 103
106 int arg0 = 0; 104 int arg0 = 0;
107 105
108 if (!PyArg_ParseTuple(args, "i", &arg0)) 106 if (!PyArg_ParseTuple(args, "i", &arg0))
109 { 107 {
110 // TODO => RAISE : https://stackoverflow.com/questions/60832317
111 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 108 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
112 return NULL; 109 return NULL;
113 } 110 }
114 OrthancPlugins::OrthancString s; 111 OrthancPlugins::OrthancString s;
115 s.Assign(OrthancPluginSubmitJob(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); 112 s.Assign(OrthancPluginSubmitJob(OrthancPlugins::GetGlobalContext(), self->object_, arg0));
116 113
117 if (s.GetContent() == NULL) 114 if (s.GetContent() == NULL)
118 { 115 {
119 // TODO => RAISE : https://stackoverflow.com/questions/60832317 116 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
120 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError);
121 PyErr_SetString(PyExc_ValueError, "Internal error");
122 return NULL; 117 return NULL;
123 } 118 }
124 else 119 else
125 { 120 {
126 return PyUnicode_FromString(s.GetContent()); 121 return PyUnicode_FromString(s.GetContent());