32 #include <boost/python.hpp> 33 #include "G4StateManager.hh" 34 #include "G4ExceptionSeverity.hh" 45 const char* exceptionCode,
46 G4ExceptionSeverity severity,
47 const char* description)
50 G4VExceptionHandler* exceptionHandler
51 = G4StateManager::GetStateManager()-> GetExceptionHandler();
52 G4bool toBeAborted =
true;
53 if(exceptionHandler) {
54 toBeAborted = exceptionHandler
55 -> Notify(originOfException,exceptionCode,severity,description);
57 G4String e_banner =
"\n!!!!! - !!!!! - !!!!! - !!!!! - !!!!! - !!!!!\n";
58 G4String w_banner =
"\nwwwww - wwwww - wwwww - wwwww - wwwww - wwwww\n";
59 std::ostringstream message;
60 message <<
"\n*** ExceptionHandler is not defined ***\n" 61 <<
"*** G4Exception : " << exceptionCode << G4endl
62 <<
" issued by : " << originOfException << G4endl
63 << description << G4endl;
66 G4cerr << e_banner << message.str() <<
"*** Fatal Exception ***" 69 case FatalErrorInArgument:
70 G4cerr << e_banner << message.str() <<
"*** Fatal Error In Argument ***" 73 case RunMustBeAborted:
74 G4cerr << e_banner << message.str() <<
"*** Run Must Be Aborted ***" 77 case EventMustBeAborted:
78 G4cerr << e_banner << message.str() <<
"*** Event Must Be Aborted ***" 82 G4cout << w_banner << message.str()
83 <<
"*** This is just a warning message. ***" 91 if(G4StateManager::GetStateManager()->SetNewState(G4State_Abort)) {
92 G4cerr << G4endl <<
"*** G4Exception: Aborting execution ***" << G4endl;
93 PyErr_SetString(PyExc_RuntimeError, description);
96 G4cerr << G4endl <<
"*** G4Exception: Abortion suppressed ***" 97 << G4endl <<
"*** No guarantee for further execution ***"
void export_G4Exception()
void f2_G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)