py::builtins::BaseException¶
Defined in <pypp/builtins/exceptions.hpp>
class BaseException;
py::builtins::BaseException provided a consistant interface for
handling exceptions. All exceptions raised (thrown) by PyPP inherit
from this class.
Example¶
#include <pypp/builtins.hpp>
int main()
{
try
{
py::raise(py::BaseException("example exception"));
}
catch (py::BaseException& exception)
{
py::print("exception handled successfully:", exception);
}
}
Output:
exception handled successfully: example exception