Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:29:50

0001 #ifndef SimG4Core_SimG4Exception_H
0002 #define SimG4Core_SimG4Exception_H
0003 
0004 #include <exception>
0005 #include <string>
0006 
0007 /** Generic mantis exception. 
0008  *  Can be thrown directly, or derived from.
0009  *  SimG4 should (ideally) only throw exceptions derived from 
0010  *  this class.
0011  */
0012 
0013 class SimG4Exception : public std::exception {
0014 public:
0015   SimG4Exception(const std::string& message) : error_(message) {}
0016   ~SimG4Exception() throw() override {}
0017   const char* what() const throw() override { return error_.c_str(); }
0018 
0019 private:
0020   std::string error_;
0021 };
0022 
0023 #endif