Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <boost/python.hpp>
|
||||
#include "G4VExceptionHandler.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace boost::python;
|
||||
|
||||
@@ -52,43 +53,47 @@ public:
|
||||
G4ExceptionSeverity severity,
|
||||
const char* description) {
|
||||
|
||||
G4cerr << "*** G4Exception : " << exceptionCode << G4endl;
|
||||
G4cerr << " issued by : " << originOfException << G4endl;
|
||||
G4cerr << description << G4endl;
|
||||
G4cerr << G4endl << "Severity : ";
|
||||
|
||||
std::ostringstream message;
|
||||
message << "*** G4Exception : " << exceptionCode << G4endl
|
||||
<< " issued by : " << originOfException << G4endl
|
||||
<< description << G4endl;
|
||||
|
||||
switch(severity) {
|
||||
case FatalException:
|
||||
PyErr_SetString(PyExc_AssertionError,
|
||||
"*** Fatal Exception ***");
|
||||
PyErr_Print();
|
||||
G4cerr << message.str() << G4endl;
|
||||
break;
|
||||
|
||||
case FatalErrorInArgument:
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"*** Fatal Error In Argument ***");
|
||||
PyErr_Print();
|
||||
G4cerr << message.str() << G4endl;
|
||||
break;
|
||||
|
||||
case RunMustBeAborted:
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"*** Run Must Be Aborted ***");
|
||||
PyErr_Print();
|
||||
G4cerr << message.str() << G4endl;
|
||||
break;
|
||||
|
||||
case EventMustBeAborted:
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"*** Event Must Be Aborted ***");
|
||||
PyErr_Print();
|
||||
G4cerr << message.str() << G4endl;
|
||||
break;
|
||||
|
||||
default:
|
||||
PyErr_Warn(PyExc_RuntimeWarning,
|
||||
"*** This is just a warning message. ***");
|
||||
G4cerr << message.str() << G4endl;
|
||||
break;
|
||||
}
|
||||
|
||||
G4cerr << G4endl;
|
||||
|
||||
// anyway, no abort.
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user