33 #include <boost/python.hpp>
38 using namespace boost::python;
47 sm-> SetExceptionHandler(
this);
52 const char* exceptionCode,
54 const char* description) {
56 std::ostringstream message;
57 message <<
"*** G4Exception : " << exceptionCode <<
G4endl
58 <<
" issued by : " << originOfException <<
G4endl
63 PyErr_SetString(PyExc_AssertionError,
64 "*** Fatal Exception ***");
70 PyErr_SetString(PyExc_ValueError,
71 "*** Fatal Error In Argument ***");
77 PyErr_SetString(PyExc_RuntimeError,
78 "*** Run Must Be Aborted ***");
84 PyErr_SetString(PyExc_RuntimeError,
85 "*** Event Must Be Aborted ***");
91 PyErr_Warn(PyExc_RuntimeWarning,
92 "*** This is just a warning message. ***");
107 class_<PyG4ExceptionHandler, boost::noncopyable>
108 (
"G4ExceptionHandler",
"exception handler")