Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
PyG4ExceptionHandler Class Reference
Inheritance diagram for PyG4ExceptionHandler:
G4VExceptionHandler

Public Member Functions

 PyG4ExceptionHandler ()
 
 ~PyG4ExceptionHandler ()
 
G4bool Notify (const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
 
- Public Member Functions inherited from G4VExceptionHandler
 G4VExceptionHandler ()
 
virtual ~G4VExceptionHandler ()
 
G4int operator== (const G4VExceptionHandler &right) const
 
G4int operator!= (const G4VExceptionHandler &right) const
 

Detailed Description

Definition at line 42 of file pyG4ExceptionHandler.cc.

Constructor & Destructor Documentation

PyG4ExceptionHandler::PyG4ExceptionHandler ( )
inline
PyG4ExceptionHandler::~PyG4ExceptionHandler ( )
inline

Definition at line 48 of file pyG4ExceptionHandler.cc.

48 { }

Member Function Documentation

G4bool PyG4ExceptionHandler::Notify ( const char *  originOfException,
const char *  exceptionCode,
G4ExceptionSeverity  severity,
const char *  description 
)
inlinevirtual

Implements G4VExceptionHandler.

Definition at line 50 of file pyG4ExceptionHandler.cc.

References EventMustBeAborted, FatalErrorInArgument, FatalException, G4cerr, G4endl, and RunMustBeAborted.

53  {
54 
55  std::ostringstream message;
56  message << "*** G4Exception : " << exceptionCode << G4endl
57  << " issued by : " << originOfException << G4endl
58  << description << G4endl;
59 
60  switch(severity) {
61  case FatalException:
62  PyErr_SetString(PyExc_AssertionError,
63  "*** Fatal Exception ***");
64  PyErr_Print();
65  G4cerr << message.str() << G4endl;
66  break;
67 
69  PyErr_SetString(PyExc_ValueError,
70  "*** Fatal Error In Argument ***");
71  PyErr_Print();
72  G4cerr << message.str() << G4endl;
73  break;
74 
75  case RunMustBeAborted:
76  PyErr_SetString(PyExc_RuntimeError,
77  "*** Run Must Be Aborted ***");
78  PyErr_Print();
79  G4cerr << message.str() << G4endl;
80  break;
81 
82  case EventMustBeAborted:
83  PyErr_SetString(PyExc_RuntimeError,
84  "*** Event Must Be Aborted ***");
85  PyErr_Print();
86  G4cerr << message.str() << G4endl;
87  break;
88 
89  default:
90  PyErr_Warn(PyExc_RuntimeWarning,
91  "*** This is just a warning message. ***");
92  G4cerr << message.str() << G4endl;
93  break;
94  }
95 
96  // anyway, no abort.
97  return false;
98  }
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr

The documentation for this class was generated from the following file: