32 #include <boost/python.hpp>
37 using namespace boost::python;
46 sm-> SetExceptionHandler(
this);
50 G4bool Notify(
const char* originOfException,
51 const char* exceptionCode,
53 const char* description) {
56 message <<
"*** G4Exception : " << exceptionCode <<
G4endl
57 <<
" issued by : " << originOfException <<
G4endl
62 PyErr_SetString(PyExc_AssertionError,
63 "*** Fatal Exception ***");
69 PyErr_SetString(PyExc_ValueError,
70 "*** Fatal Error In Argument ***");
76 PyErr_SetString(PyExc_RuntimeError,
77 "*** Run Must Be Aborted ***");
83 PyErr_SetString(PyExc_RuntimeError,
84 "*** Event Must Be Aborted ***");
90 PyErr_Warn(PyExc_RuntimeWarning,
91 "*** This is just a warning message. ***");
106 class_<PyG4ExceptionHandler, boost::noncopyable>
107 (
"G4ExceptionHandler",
"exception handler")