Commit ae1cb3d3 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Revert G4ExceptionHandler

parent 4a50d5d8
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@
#define ALLPIX_GEANT4_EXCEPTIONS_H

#include "core/module/exceptions.h"
#include "core/utils/log.h"

#include <G4VExceptionHandler.hh>

@@ -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));
        };
    };