comparison Sources/IncomingHttpRequestFilter.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 28531e615104
comparison
equal deleted inserted replaced
170:b49eeb36cd0d 171:c8de83fe7faa
92 args.GetPyObject(), kw.GetPyObject())); 92 args.GetPyObject(), kw.GetPyObject()));
93 93
94 std::string traceback; 94 std::string traceback;
95 if (lock.HasErrorOccurred(traceback)) 95 if (lock.HasErrorOccurred(traceback))
96 { 96 {
97 OrthancPlugins::LogError("Error in the Python incoming-http-request filter, " 97 ORTHANC_PLUGINS_LOG_ERROR("Error in the Python incoming-http-request filter, traceback:\n" + traceback);
98 "traceback:\n" + traceback);
99 return -1; 98 return -1;
100 } 99 }
101 else 100 else
102 { 101 {
103 if (PyBool_Check(result.GetPyObject())) 102 if (PyBool_Check(result.GetPyObject()))
104 { 103 {
105 return (PyObject_IsTrue(result.GetPyObject()) ? 1 /* allowed */ : 0 /* forbidden */); 104 return (PyObject_IsTrue(result.GetPyObject()) ? 1 /* allowed */ : 0 /* forbidden */);
106 } 105 }
107 else 106 else
108 { 107 {
109 OrthancPlugins::LogError("The Python incoming-http-request filter has not returned a Boolean"); 108 ORTHANC_PLUGINS_LOG_ERROR("The Python incoming-http-request filter has not returned a Boolean");
110 return -1; 109 return -1;
111 } 110 }
112 } 111 }
113 } 112 }
114 catch (OrthancPlugins::PluginException& e) 113 catch (OrthancPlugins::PluginException& e)
115 { 114 {
116 OrthancPlugins::LogError("Exception in the Python incoming-http-request filter: " + 115 ORTHANC_PLUGINS_LOG_ERROR("Exception in the Python incoming-http-request filter: " +
117 std::string(e.What(OrthancPlugins::GetGlobalContext()))); 116 std::string(e.What(OrthancPlugins::GetGlobalContext())));
118 return e.GetErrorCode(); 117 return e.GetErrorCode();
119 } 118 }
120 } 119 }
121 120
122 121