Loading src/tools/geant4/G4ExceptionHandler.hpp +2 −15 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ #define ALLPIX_GEANT4_EXCEPTIONS_H #include "core/module/exceptions.h" #include "core/utils/log.h" #include <G4VExceptionHandler.hh> Loading @@ -28,20 +27,8 @@ namespace allpix { */ class G4ExceptionHandler : public G4VExceptionHandler { public: G4bool Notify(const char*, const char* code, G4ExceptionSeverity severity, const char* description) override { std::string message = "Caught Geant4 exception " + std::string(code) + ": " + std::string(description); if(severity == G4ExceptionSeverity::JustWarning) { LOG(WARNING) << message; } else if(severity == G4ExceptionSeverity::EventMustBeAborted) { throw AbortEventException(message); } else if(severity == G4ExceptionSeverity::RunMustBeAborted) { throw EndOfRunException(message); } else { throw ModuleError(message); } // Continue program execution: return false; G4bool Notify(const char*, const char* exceptionCode, G4ExceptionSeverity, const char* description) override { throw ModuleError("Caught Geant4 exception " + std::string(exceptionCode) + ": " + std::string(description)); }; }; Loading Loading
src/tools/geant4/G4ExceptionHandler.hpp +2 −15 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ #define ALLPIX_GEANT4_EXCEPTIONS_H #include "core/module/exceptions.h" #include "core/utils/log.h" #include <G4VExceptionHandler.hh> Loading @@ -28,20 +27,8 @@ namespace allpix { */ class G4ExceptionHandler : public G4VExceptionHandler { public: G4bool Notify(const char*, const char* code, G4ExceptionSeverity severity, const char* description) override { std::string message = "Caught Geant4 exception " + std::string(code) + ": " + std::string(description); if(severity == G4ExceptionSeverity::JustWarning) { LOG(WARNING) << message; } else if(severity == G4ExceptionSeverity::EventMustBeAborted) { throw AbortEventException(message); } else if(severity == G4ExceptionSeverity::RunMustBeAborted) { throw EndOfRunException(message); } else { throw ModuleError(message); } // Continue program execution: return false; G4bool Notify(const char*, const char* exceptionCode, G4ExceptionSeverity, const char* description) override { throw ModuleError("Caught Geant4 exception " + std::string(exceptionCode) + ": " + std::string(description)); }; }; Loading