comparison Sources/StorageCommitmentScpCallback.cpp @ 171:c8de83fe7faa

removed deprecation warnings
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Jun 2024 15:52:51 +0200
parents 6fada29b6759
children b124c74e6968
comparison
equal deleted inserted replaced
170:b49eeb36cd0d 171:c8de83fe7faa
82 *handler = result.Release(); 82 *handler = result.Release();
83 83
84 std::string traceback; 84 std::string traceback;
85 if (lock.HasErrorOccurred(traceback)) 85 if (lock.HasErrorOccurred(traceback))
86 { 86 {
87 OrthancPlugins::LogError("Error in the Python storage commitment SCP callback, " 87 ORTHANC_PLUGINS_LOG_ERROR("Error in the Python storage commitment SCP callback, traceback:\n" + traceback);
88 "traceback:\n" + traceback);
89 return OrthancPluginErrorCode_Plugin; 88 return OrthancPluginErrorCode_Plugin;
90 } 89 }
91 } 90 }
92 catch (OrthancPlugins::PluginException& e) 91 catch (OrthancPlugins::PluginException& e)
93 { 92 {
94 OrthancPlugins::LogError("Error in the Python storage commitment SCP callback: " + 93 ORTHANC_PLUGINS_LOG_ERROR("Error in the Python storage commitment SCP callback: " +
95 std::string(e.What(OrthancPlugins::GetGlobalContext()))); 94 std::string(e.What(OrthancPlugins::GetGlobalContext())));
96 } 95 }
97 return OrthancPluginErrorCode_Success; 96 return OrthancPluginErrorCode_Success;
98 } 97 }
99 98
100 static OrthancPluginErrorCode StorageCommitmentLookupCallback( 99 static OrthancPluginErrorCode StorageCommitmentLookupCallback(
124 123
125 PythonObject result(lock, PyObject_CallObject(storageCommitmentLookupCallback_, args.GetPyObject())); 124 PythonObject result(lock, PyObject_CallObject(storageCommitmentLookupCallback_, args.GetPyObject()));
126 125
127 if (!PyLong_Check(result.GetPyObject())) 126 if (!PyLong_Check(result.GetPyObject()))
128 { 127 {
129 OrthancPlugins::LogError("The Python storage commitment Lookup callback has not returned an int as the return value"); 128 ORTHANC_PLUGINS_LOG_ERROR("The Python storage commitment Lookup callback has not returned an int as the return value");
130 return OrthancPluginErrorCode_Plugin; 129 return OrthancPluginErrorCode_Plugin;
131 } 130 }
132 131
133 *target = static_cast<OrthancPluginStorageCommitmentFailureReason>(PyLong_AsLong(result.GetPyObject())); 132 *target = static_cast<OrthancPluginStorageCommitmentFailureReason>(PyLong_AsLong(result.GetPyObject()));
134 133
135 std::string traceback; 134 std::string traceback;
136 if (lock.HasErrorOccurred(traceback)) 135 if (lock.HasErrorOccurred(traceback))
137 { 136 {
138 OrthancPlugins::LogError("Error in the Python storage commitment Lookup callback, " 137 ORTHANC_PLUGINS_LOG_ERROR("Error in the Python storage commitment Lookup callback, traceback:\n" + traceback);
139 "traceback:\n" + traceback);
140 return OrthancPluginErrorCode_Plugin; 138 return OrthancPluginErrorCode_Plugin;
141 } 139 }
142 } 140 }
143 catch (OrthancPlugins::PluginException& e) 141 catch (OrthancPlugins::PluginException& e)
144 { 142 {
145 OrthancPlugins::LogError("Error in the Python storage commitment Lookup callback: " + 143 ORTHANC_PLUGINS_LOG_ERROR("Error in the Python storage commitment Lookup callback: " +
146 std::string(e.What(OrthancPlugins::GetGlobalContext()))); 144 std::string(e.What(OrthancPlugins::GetGlobalContext())));
147 } 145 }
148 return OrthancPluginErrorCode_Success; 146 return OrthancPluginErrorCode_Success;
149 } 147 }
150 148
151 static void StorageCommitmentDestructor(void *handler) 149 static void StorageCommitmentDestructor(void *handler)