Commit 385b7367 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

DepositionReader: throw if we could not instantiate a reader

(never triggered because config checks for valid model values already)
parent 0d34d68b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ PrimariesReaderHepMC::PrimariesReaderHepMC(const Configuration& config) {
    } else if(model == FileModel::HEPMCTTREE) {
        file_path = config.getPathWithExtension("file_name", "root", true);
        reader_ = std::make_unique<HepMC3::ReaderRootTree>(file_path);
    } else {
        throw InvalidValueError(config, "model", "failed to instantiate file reader");
    }

    if(reader_->failed()) {