42 #include "G4String.hh" 43 #include "G4StateManager.hh" 46 const char* exceptionCode,
47 G4ExceptionSeverity severity,
48 const char* description)
52 bool skipPrintIt = exceptCodeStr.find(
"GeomNav") != std::string::npos;
53 if (severity == JustWarning && skipPrintIt)
return;
54 G4VExceptionHandler* exceptionHandler
55 = G4StateManager::GetStateManager()->GetExceptionHandler();
56 G4bool toBeAborted =
true;
59 toBeAborted = exceptionHandler
60 ->Notify(originOfException,exceptionCode,severity,description);
64 static const G4String es_banner
65 =
"\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n";
66 static const G4String ee_banner
67 =
"\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n";
68 static const G4String ws_banner
69 =
"\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
70 static const G4String we_banner
71 =
"\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n";
73 message <<
"\n*** ExceptionHandler is not defined ***\n" 74 <<
"*** G4Exception : " << exceptionCode << G4endl
75 <<
" issued by : " << originOfException << G4endl
76 << description << G4endl;
80 G4cerr << es_banner << message.str() <<
"*** Fatal Exception ***" 81 << ee_banner << G4endl;
83 case FatalErrorInArgument:
84 G4cerr << es_banner << message.str() <<
"*** Fatal Error In Argument ***" 85 << ee_banner << G4endl;
87 case RunMustBeAborted:
88 G4cerr << es_banner << message.str() <<
"*** Run Must Be Aborted ***" 89 << ee_banner << G4endl;
91 case EventMustBeAborted:
92 G4cerr << es_banner << message.str() <<
"*** Event Must Be Aborted ***" 93 << ee_banner << G4endl;
96 G4cout << ws_banner << message.str()
97 <<
"*** This is just a warning message. ***" 98 << we_banner << G4endl;
105 if(G4StateManager::GetStateManager()->SetNewState(G4State_Abort))
107 G4cerr << G4endl <<
"*** G4Exception: Aborting execution ***" << G4endl;
112 G4cerr << G4endl <<
"*** G4Exception: Abortion suppressed ***" 113 << G4endl <<
"*** No guarantee for further execution ***" << G4endl;
119 const char* exceptionCode,
120 G4ExceptionSeverity severity,
121 G4ExceptionDescription & description)
123 G4String des = description.str();
124 G4Exception(originOfException, exceptionCode, severity, des.c_str());
128 const char* exceptionCode,
129 G4ExceptionSeverity severity,
130 G4ExceptionDescription & description,
133 description << comments << G4endl;
134 G4Exception(originOfException, exceptionCode, severity, description);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static QList< CommentInPrepass > comments