itpp_sci  1.0.0
it++ based simulation framework for scicoslab, scilab and scipy
_sci_exception.hpp
1 
6 #ifndef SCI_EXCEPTION_HPP
7 #define SCI_EXCEPTION_HPP
8 
9 #include <stdexcept>
10 
11 class sci_exception : public std::runtime_error
12 {
13  int info_;
14  char *msg_;
15 public:
16 
17  sci_exception(char * msg, int info): std::runtime_error(msg), msg_(msg) , info_(info) {};
18  sci_exception(char * msg): std::runtime_error(msg), msg_(msg)
19  {
20  info_ = 0;
21  };
22  sci_exception(): std::runtime_error("Unknown Error")
23  {
24  msg_ = "Unknown Error";
25  info_ = -1;
26  };
27 
28  int get_info() const
29  {
30  return info_;
31  };
32  const char* get_msg()
33  {
34  return msg_;
35  };
36 
37 };
38 
39 #endif