[ 
https://issues.apache.org/jira/browse/MINIFICPP-2387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gábor Gyimesi updated MINIFICPP-2387:
-------------------------------------
    Description: 
Errors are handled multiple ways in the
 * throwing PythonScriptException
 * throwing PyException
 * setting PyErr_SetString

The error handling should be revised. In case of the minifi_native python 
module we should probably set the error with PyErr_SetString instead of 
throwing exceptions that would result in throwing exception in python instead 
of the c++ code. We should focus on having better error messages and tracebacks 
in the logs in case of an error to be able to identify the source of the error.

We are also using PyErr_Fetch and PyErr_Restore functions that are deprecated 
since Python 3.12 so we should see if they could be replaced with something 
that is both available in older and newer versions too.

  was:
Errors are handled multiple ways in the
 * throwing PythonScriptException
 * throwing PyException
 * setting PyErr_SetString

The error handling should be revised. In case of the minifi_native python 
module we should probably set the error with PyErr_SetString instead of 
throwing exceptions that would result in throwing exception in python instead 
of the c++ code. We should focus on having better error messages and tracebacks 
in the logs in case of an error to be able to identify the source of the error.

We are also using PyErr_Fetch and PyErr_Restore functions that are deprecated 
since Python 3.12 and should be replaced.


> Improve error handling in Python processors
> -------------------------------------------
>
>                 Key: MINIFICPP-2387
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-2387
>             Project: Apache NiFi MiNiFi C++
>          Issue Type: Improvement
>            Reporter: Gábor Gyimesi
>            Assignee: Gábor Gyimesi
>            Priority: Major
>
> Errors are handled multiple ways in the
>  * throwing PythonScriptException
>  * throwing PyException
>  * setting PyErr_SetString
> The error handling should be revised. In case of the minifi_native python 
> module we should probably set the error with PyErr_SetString instead of 
> throwing exceptions that would result in throwing exception in python instead 
> of the c++ code. We should focus on having better error messages and 
> tracebacks in the logs in case of an error to be able to identify the source 
> of the error.
> We are also using PyErr_Fetch and PyErr_Restore functions that are deprecated 
> since Python 3.12 so we should see if they could be replaced with something 
> that is both available in older and newer versions too.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to