76{
77 static const G4String es_banner =
78 "\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n";
79 static const G4String ee_banner =
80 "\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n";
81 static const G4String ws_banner =
82 "\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
83 static const G4String we_banner =
84 "\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n";
85 std::ostringstream message;
86 message <<
"*** G4Exception : " << exceptionCode <<
G4endl
87 <<
" issued by : " << originOfException <<
G4endl << description <<
G4endl;
88 G4bool abortionForCoreDump =
false;
90 switch (severity) {
92 G4cerr << es_banner << message.str() <<
"*** Fatal Exception *** core dump ***" <<
G4endl;
93 DumpTrackInfo();
95 abortionForCoreDump = true;
96 break;
98 G4cerr << es_banner << message.str() <<
"*** Fatal Error In Argument *** core dump ***"
100 DumpTrackInfo();
102 abortionForCoreDump = true;
103 break;
106 G4cerr << es_banner << message.str() <<
"*** Run Must Be Aborted ***" <<
G4endl;
107 DumpTrackInfo();
110 }
111 abortionForCoreDump = false;
112 break;
115 G4cerr << es_banner << message.str() <<
"*** Event Must Be Aborted ***" <<
G4endl;
116 DumpTrackInfo();
119 }
120 abortionForCoreDump = false;
121 break;
123 if(IfPrint(exceptionCode))
124 {
125 std::ostringstream wmessage;
126 wmessage <<
"*** G4Exception : " << exceptionCode <<
G4endl
127 <<
" issued by : " << originOfException <<
G4endl << description <<
G4endl;
128 G4cout << ws_banner << wmessage.str() <<
"*** This is just a warning message. ***" << we_banner
130 }
131 abortionForCoreDump = false;
132 break;
133 default:
134 abortionForCoreDump = false;
135 break;
136 }
137 return abortionForCoreDump;
138}
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
virtual void AbortRun(G4bool softAbort=false)
static G4RunManager * GetRunManager()
virtual void AbortEvent()
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()