37{
41 if(exceptionHandler != nullptr)
42 {
43 toBeAborted = exceptionHandler->
Notify(originOfException, exceptionCode,
44 severity, description);
45 }
46 else
47 {
52 std::ostringstream message;
53 message << "\n*** ExceptionHandler is not defined ***\n"
54 <<
"*** G4Exception : " << exceptionCode <<
G4endl
55 <<
" issued by : " << originOfException <<
G4endl
57 switch(severity)
58 {
60 G4cerr << es_banner << message.str() <<
"*** Fatal Exception ***"
62 break;
64 G4cerr << es_banner << message.str()
65 <<
"*** Fatal Error In Argument ***" << ee_banner <<
G4endl;
66 break;
68 G4cerr << es_banner << message.str() <<
"*** Run Must Be Aborted ***"
70 break;
72 G4cerr << es_banner << message.str() <<
"*** Event Must Be Aborted ***"
74 break;
75 default:
76 G4cout << ws_banner << message.str()
77 << "*** This is just a warning message. ***" << we_banner
79 toBeAborted = false;
80 break;
81 }
82 }
83 if(toBeAborted)
84 {
86 {
88 abort();
89 }
90 else
91 {
93 <<
"*** No guarantee for further execution ***" <<
G4endl;
94 }
95 }
96}
const G4String G4ExceptionErrBannerEnd()
const G4String G4ExceptionErrBannerStart()
const G4String G4ExceptionWarnBannerEnd()
const G4String G4ExceptionWarnBannerStart()
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4VExceptionHandler * GetExceptionHandler() const
static G4StateManager * GetStateManager()
virtual G4bool Notify(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)=0