33 #include <boost/python.hpp>
37 using namespace boost::python;
42 namespace pyG4Exception {
46 const char* exceptionCode,
48 const char* description)
54 if(exceptionHandler) {
55 toBeAborted = exceptionHandler
56 -> Notify(originOfException,exceptionCode,severity,description);
58 G4String e_banner =
"\n!!!!! - !!!!! - !!!!! - !!!!! - !!!!! - !!!!!\n";
59 G4String w_banner =
"\nwwwww - wwwww - wwwww - wwwww - wwwww - wwwww\n";
60 std::ostringstream message;
61 message <<
"\n*** ExceptionHandler is not defined ***\n"
62 <<
"*** G4Exception : " << exceptionCode <<
G4endl
63 <<
" issued by : " << originOfException <<
G4endl
67 G4cerr << e_banner << message.str() <<
"*** Fatal Exception ***"
71 G4cerr << e_banner << message.str() <<
"*** Fatal Error In Argument ***"
75 G4cerr << e_banner << message.str() <<
"*** Run Must Be Aborted ***"
79 G4cerr << e_banner << message.str() <<
"*** Event Must Be Aborted ***"
83 G4cout << w_banner << message.str()
84 <<
"*** This is just a warning message. ***"
94 PyErr_SetString(PyExc_RuntimeError, description);
97 G4cerr <<
G4endl <<
"*** G4Exception: Abortion suppressed ***"
98 <<
G4endl <<
"*** No guarantee for further execution ***"
106 using namespace pyG4Exception;