pyd.exception

Contains utilities for safely wrapping python exceptions in D and vice versa.

Members

Aliases

exception_catcher_PyObjectPtr
alias exception_catcher_PyObjectPtr = exception_catcher!(PyObject*)
Undocumented in source.
exception_catcher_int
alias exception_catcher_int = exception_catcher!(int)
Undocumented in source.
exception_catcher_void
alias exception_catcher_void = exception_catcher!(void)
Undocumented in source.

Classes

PythonException
class PythonException

This simple exception class holds a Python exception.

Functions

error_code
T error_code()
Undocumented in source. Be warned that the author may not have intended to support it.
exception_catcher
T exception_catcher(T delegate() dg)

It is intended that any functions that interface directly with Python which have the possibility of a D exception being raised wrap their contents in a call to this function, e.g.:

exception_catcher_nogc
T exception_catcher_nogc(T delegate() dg)
Undocumented in source. Be warned that the author may not have intended to support it.
handle_exception
void handle_exception(string file, size_t line)

This function first checks if a Python exception is set, and then (if one is) pulls it out, stuffs it in a PythonException, and throws that exception.

printGenericError
string printGenericError(PyObject* type, PyObject* value, PyObject* traceback)
Undocumented in source. Be warned that the author may not have intended to support it.
printSyntaxError
string printSyntaxError(PyObject* type, PyObject* value, PyObject* traceback)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta