45{
49 if(exceptionHandler)
50 {
51 toBeAborted = exceptionHandler
52 ->
Notify(originOfException,exceptionCode,severity,description);
53 }
54 else
55 {
57 = "\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n";
59 = "\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n";
61 = "\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
63 = "\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n";
64 std::ostringstream message;
65 message << "\n*** ExceptionHandler is not defined ***\n"
66 <<
"*** G4Exception : " << exceptionCode <<
G4endl
67 <<
" issued by : " << originOfException <<
G4endl
69 switch(severity)
70 {
72 G4cerr << es_banner << message.str() <<
"*** Fatal Exception ***"
74 break;
76 G4cerr << es_banner << message.str() <<
"*** Fatal Error In Argument ***"
78 break;
80 G4cerr << es_banner << message.str() <<
"*** Run Must Be Aborted ***"
82 break;
84 G4cerr << es_banner << message.str() <<
"*** Event Must Be Aborted ***"
86 break;
87 default:
88 G4cout << ws_banner << message.str()
89 << "*** This is just a warning message. ***"
91 toBeAborted = false;
92 break;
93 }
94 }
95 if(toBeAborted)
96 {
98 {
100 abort();
101 }
102 else
103 {
104 G4cerr <<
G4endl <<
"*** G4Exception: Abortion suppressed ***"
105 <<
G4endl <<
"*** No guarantee for further execution ***" <<
G4endl;
106 }
107 }
108}
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4VExceptionHandler * GetExceptionHandler() const
static G4StateManager * GetStateManager()
virtual G4bool Notify(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)=0