the base exception class
| 60 | |
| 61 | // the base exception class |
| 62 | class error : public std::exception |
| 63 | { |
| 64 | /*! |
| 65 | WHAT THIS OBJECT REPRESENTS |
| 66 | This is the base exception class for the dlib library. i.e. all |
| 67 | exceptions in this library inherit from this class. |
| 68 | !*/ |
| 69 | |
| 70 | public: |
| 71 | error( |
| 72 | error_type t, |
| 73 | const std::string& a |
| 74 | ): info(a), type(t) {} |
| 75 | /*! |
| 76 | ensures |
| 77 | - #type == t |
| 78 | - #info == a |
| 79 | !*/ |
| 80 | |
| 81 | error( |
| 82 | error_type t |
| 83 | ): type(t) {} |
| 84 | /*! |
| 85 | ensures |
| 86 | - #type == t |
| 87 | - #info == "" |
| 88 | !*/ |
| 89 | |
| 90 | error( |
| 91 | const std::string& a |
| 92 | ): info(a), type(EUNSPECIFIED) {} |
| 93 | /*! |
| 94 | ensures |
| 95 | - #type == EUNSPECIFIED |
| 96 | - #info == a |
| 97 | !*/ |
| 98 | |
| 99 | error( |
| 100 | ): type(EUNSPECIFIED) {} |
| 101 | /*! |
| 102 | ensures |
| 103 | - #type == EUNSPECIFIED |
| 104 | - #info == "" |
| 105 | !*/ |
| 106 | |
| 107 | virtual ~error( |
| 108 | ) noexcept {} |
| 109 | /*! |
| 110 | ensures |
| 111 | - does nothing |
| 112 | !*/ |
| 113 | |
| 114 | const char* what( |
| 115 | ) const noexcept |
| 116 | /*! |
| 117 | ensures |
| 118 | - if (info.size() != 0) then |
| 119 | - returns info.c_str() |
no outgoing calls