32 #include <boost/python.hpp>
37 using namespace boost::python;
46 sm-> SetExceptionHandler(
this);
51 const char* exceptionCode,
53 const char* description) {
55 std::ostringstream message;
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")
static G4StateManager * GetStateManager()
void export_G4ExceptionHandler()
G4GLOB_DLL std::ostream G4cerr
G4bool Notify(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)