38inline const G4String G4ExceptionErrBannerStart()
40 return "\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n";
42inline const G4String G4ExceptionWarnBannerStart()
44 return "\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
47inline const G4String G4ExceptionErrBannerEnd()
49 return "\n-------- EEEE ------- G4Exception-END -------- EEEE -------\n";
51inline const G4String G4ExceptionWarnBannerEnd()
53 return "\n-------- WWWW ------- G4Exception-END -------- WWWW -------\n";
59void G4Exception(
const char* originOfException,
const char* exceptionCode,
65 if(exceptionHandler !=
nullptr)
67 toBeAborted = exceptionHandler->
Notify(originOfException, exceptionCode,
68 severity, description);
72 static const G4String& es_banner = G4ExceptionErrBannerStart();
73 static const G4String& ee_banner = G4ExceptionErrBannerEnd();
74 static const G4String& ws_banner = G4ExceptionWarnBannerStart();
75 static const G4String& we_banner = G4ExceptionWarnBannerEnd();
76 std::ostringstream message;
77 message <<
"\n*** ExceptionHandler is not defined ***\n"
78 <<
"*** G4Exception : " << exceptionCode <<
G4endl
79 <<
" issued by : " << originOfException <<
G4endl
84 G4cerr << es_banner << message.str() <<
"*** Fatal Exception ***"
88 G4cerr << es_banner << message.str()
89 <<
"*** Fatal Error In Argument ***" << ee_banner <<
G4endl;
92 G4cerr << es_banner << message.str() <<
"*** Run Must Be Aborted ***"
96 G4cerr << es_banner << message.str() <<
"*** Event Must Be Aborted ***"
100 G4cout << ws_banner << message.str()
101 <<
"*** This is just a warning message. ***" << we_banner
117 <<
"*** No guarantee for further execution ***" <<
G4endl;
123void G4Exception(
const char* originOfException,
const char* exceptionCode,
128 G4Exception(originOfException, exceptionCode, severity, des.c_str());
132void G4Exception(
const char* originOfException,
const char* exceptionCode,
136 description << comments <<
G4endl;
137 G4Exception(originOfException, exceptionCode, severity, description);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
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