evio  6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EvioException.h
Go to the documentation of this file.
1 //
2 // Copyright 2020, Jefferson Science Associates, LLC.
3 // Subject to the terms in the LICENSE file found in the top-level directory.
4 //
5 // EPSCI Group
6 // Thomas Jefferson National Accelerator Facility
7 // 12000, Jefferson Ave, Newport News, VA 23606
8 // (757)-269-7100
9 
10 
11 #ifndef EVIO_6_0_EVIOEXCEPTION_H
12 #define EVIO_6_0_EVIOEXCEPTION_H
13 
14 
15 #include <iostream>
16 #include <sstream>
17 #include <stdexcept>
18 #include <string>
19 #include <exception>
20 
21 
22 namespace evio {
23 
29  class EvioException : public std::runtime_error {
30 
31  public:
32 
33  explicit EvioException(const std::string & msg) noexcept : std::runtime_error(msg) {}
34  explicit EvioException(const std::exception & ex) noexcept : std::runtime_error(ex.what()) {}
35 
36  EvioException(const std::string & msg, const char *file, int line) noexcept : std::runtime_error(msg) {
37  std::ostringstream o;
38  o << file << ":" << line << ":" << msg;
39  }
40 
41  };
42 
43 #define throwEvioLine(arg) throw EvioException(arg, __FILE__, __LINE__);
44 
45 }
46 
47 #endif //EVIO_6_0_EVIOEXCEPTION_H
EvioException(const std::exception &ex) noexcept
Definition: EvioException.h:34
Exception class for Evio software package.
Definition: EvioException.h:29
EvioException(const std::string &msg) noexcept
Definition: EvioException.h:33
EvioException(const std::string &msg, const char *file, int line) noexcept
Definition: EvioException.h:36