Geant4-11
Public Member Functions
PyG4ExceptionHandler Class Reference
Inheritance diagram for PyG4ExceptionHandler:
G4VExceptionHandler

Public Member Functions

G4bool Notify (const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
 
G4bool operator!= (const G4VExceptionHandler &right) const
 
G4bool operator== (const G4VExceptionHandler &right) const
 
 PyG4ExceptionHandler ()
 
 ~PyG4ExceptionHandler ()
 

Detailed Description

Definition at line 42 of file pyG4ExceptionHandler.cc.

Constructor & Destructor Documentation

◆ PyG4ExceptionHandler()

PyG4ExceptionHandler::PyG4ExceptionHandler ( )
inline

◆ ~PyG4ExceptionHandler()

PyG4ExceptionHandler::~PyG4ExceptionHandler ( )
inline

Definition at line 48 of file pyG4ExceptionHandler.cc.

48{ }

Member Function Documentation

◆ Notify()

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.

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
76 PyErr_SetString(PyExc_RuntimeError,
77 "*** Run Must Be Aborted ***");
78 PyErr_Print();
79 G4cerr << message.str() << G4endl;
80 break;
81
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 }
@ FatalException
@ FatalErrorInArgument
@ RunMustBeAborted
@ EventMustBeAborted
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57

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

◆ operator!=()

G4bool G4VExceptionHandler::operator!= ( const G4VExceptionHandler right) const
inherited

Definition at line 63 of file G4VExceptionHandler.cc.

64{
65 return (this != &right);
66}

◆ operator==()

G4bool G4VExceptionHandler::operator== ( const G4VExceptionHandler right) const
inherited

Definition at line 58 of file G4VExceptionHandler.cc.

59{
60 return (this == &right);
61}

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