CMS 3D CMS Logo

ExceptionHandler.cc
Go to the documentation of this file.
3 
5 
6 #include "globals.hh"
7 #include <sstream>
8 
10 
12 
13 bool ExceptionHandler::Notify(const char* exceptionOrigin,
14  const char* exceptionCode,
15  G4ExceptionSeverity severity,
16  const char* description) {
17  static const G4String es_banner = "\n-------- EEEE ------- G4Exception-START -------- EEEE -------\n";
18  static const G4String ee_banner = "\n-------- EEEE -------- G4Exception-END --------- EEEE -------\n";
19  static const G4String ws_banner = "\n-------- WWWW ------- G4Exception-START -------- WWWW -------\n";
20  static const G4String we_banner = "\n-------- WWWW -------- G4Exception-END --------- WWWW -------\n";
21 
22  std::stringstream message;
23  message << "*** G4Exception : " << exceptionCode << "\n"
24  << " issued by : " << exceptionOrigin << "\n"
25  << description;
26 
27  std::stringstream ss;
28  switch (severity) {
29  case FatalException:
30  case FatalErrorInArgument:
31  case RunMustBeAborted:
32  case EventMustBeAborted:
33  ss << es_banner << message.str() << ee_banner;
34  throw SimG4Exception(ss.str());
35  break;
36 
37  case JustWarning:
38  edm::LogWarning("SimG4CoreApplication")
39  << ws_banner << message.str() << "*** This is just a warning message. ***" << we_banner;
40  break;
41  }
42  return false;
43 }
MessageLogger.h
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
SimG4Exception
Definition: SimG4Exception.h:13
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
ExceptionHandler::~ExceptionHandler
~ExceptionHandler() override
Definition: ExceptionHandler.cc:11
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SimG4Exception.h
ExceptionHandler.h
ErrorSummaryFilter_cfi.severity
severity
Definition: ErrorSummaryFilter_cfi.py:5
ExceptionHandler::Notify
bool Notify(const char *exceptionOrigin, const char *exceptionCode, G4ExceptionSeverity severity, const char *description) override
Definition: ExceptionHandler.cc:13
ExceptionHandler::ExceptionHandler
ExceptionHandler()
Definition: ExceptionHandler.cc:9