CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CPExceptions.h
Go to the documentation of this file.
1 
2 
3 #ifndef CPEXCEPTIONS_H
4 #define CPEXCEPTIONS_H
5 
6 #include <exception>
7 #include <iostream>
8 
9 class CoolPropBaseError: public std::exception
10 {
11 protected:
12  std::string err; // Can be accessed by subclasses since it is protected
13 public:
14  CoolPropBaseError() throw() {};
15  ~CoolPropBaseError() throw() {};
16  virtual const char* what() const throw(){ return err.c_str(); }
17 };
18 
20 {
21 public:
22  NotImplementedError() throw() {};
23  NotImplementedError(std::string errstring) throw(){err=errstring;};
24  ~NotImplementedError() throw() {};
25  virtual const char* what() const throw(){ return err.c_str(); }
26 };
27 
29 {
30 public:
31  SolutionError()throw() {};
32  SolutionError(std::string errstring) throw(){err=errstring;};
33  ~SolutionError() throw() {};
34  virtual const char* what() const throw(){ return err.c_str(); }
35 };
36 
38 {
39 public:
40  ValueError() throw() {};
41  ValueError(std::string errstring) throw(){err=errstring;};
42  ~ValueError() throw() {};
43  virtual const char* what() const throw(){ return err.c_str(); }
44 };
45 
47 {
48 public:
49  AttributeError() throw() {};
50  AttributeError(std::string errstring) throw() {err=errstring;};
51  ~AttributeError() throw() {};
52  virtual const char* what() const throw(){ return err.c_str(); }
53 };
54 
55 #endif
AttributeError(std::string errstring)
Definition: CPExceptions.h:50
virtual const char * what() const
Definition: CPExceptions.h:43
std::string err
Definition: CPExceptions.h:12
virtual const char * what() const
Definition: CPExceptions.h:34
SolutionError(std::string errstring)
Definition: CPExceptions.h:32
ValueError(std::string errstring)
Definition: CPExceptions.h:41
virtual const char * what() const
Definition: CPExceptions.h:25
virtual const char * what() const
Definition: CPExceptions.h:52
NotImplementedError(std::string errstring)
Definition: CPExceptions.h:23
virtual const char * what() const
Definition: CPExceptions.h:16