RecompExternalPython for N64Recompiled 2.0.0
Loading...
Searching...
No Matches

Functions used for Python error handling. More...

Functions

REPY_bool REPY_IsErrorSet ()
 Checks if a Python exception was raised and caught by the REPY API.
REPY_Handle REPY_GetErrorType ()
 Get the type of a captured Python exception for the current interpreter and thread.
REPY_Handle REPY_GetErrorTrace ()
 Get the trace object for the Python exception for the current interpreter and thread.
REPY_Handle REPY_GetErrorValue ()
 Get the captured Python exception object for the current interpreter and thread.
void REPY_ClearError ()
 Releases the captured exception for the current interpreter and thread.

Detailed Description

Functions used for Python error handling.

REPY API functions will try to catch any unhandled Python errors they raise, print them to the console, and make the exception objects available through this interface. Be advised that the Python error state is thread and interpreter specific, and therefore these functions will only provide error information for the current interpreter and the current N64Recompiled thread. Errors from pure Python threads (such as those created by threading.Thread) will need to be handled by Python code in their own threads.

Note that passing bad/invalid handles (or using REPY_NO_OBJECT when not allowed) will not result in Python errors to be raised, because looking up the Python object for a given handle happens before the interpreter is invoked. As a result, such issues will result in a fatal error message being printed to REPY's log, followed by a fatal exit.

Function Documentation

◆ REPY_ClearError()

void REPY_ClearError ( )

Releases the captured exception for the current interpreter and thread.

Call once you're done with your error handling, so that REPY_IsErrorSet doesn't return true for an error already dealt with.

◆ REPY_GetErrorTrace()

REPY_Handle REPY_GetErrorTrace ( )

Get the trace object for the Python exception for the current interpreter and thread.

Note that each invokation of this method will result in a new handle being created to the trace object.

Returns
The trace object for the captured Python exception. Returns None if no exception is currently captured.

◆ REPY_GetErrorType()

REPY_Handle REPY_GetErrorType ( )

Get the type of a captured Python exception for the current interpreter and thread.

Note that each invokation of this method will result in a new handle being created to the appropriate type object.

Returns
The type for the captured Python exception. Returns None if no exception is currently captured.

◆ REPY_GetErrorValue()

REPY_Handle REPY_GetErrorValue ( )

Get the captured Python exception object for the current interpreter and thread.

Note that each invokation of this method will result in a new handle being created to the exception.

Returns
The captured Python exception. Returns None if no exception is currently captured.

◆ REPY_IsErrorSet()

REPY_bool REPY_IsErrorSet ( )

Checks if a Python exception was raised and caught by the REPY API.

If an exception was handled in Python code, then it will not be captured by REPY.

Returns
true if the REPY API currently has a Python exception captured, false otherwise.