BrainFlowException class to notify about errors
| 6 | |
| 7 | /// BrainFlowException class to notify about errors |
| 8 | class BrainFlowException : public std::exception |
| 9 | { |
| 10 | |
| 11 | public: |
| 12 | /// exit code returned from low level API |
| 13 | int exit_code; |
| 14 | |
| 15 | explicit BrainFlowException (const char *msg, int exit_code) : std::exception () |
| 16 | { |
| 17 | msg_ = std::string (msg) + std::to_string (exit_code); |
| 18 | this->exit_code = exit_code; |
| 19 | } |
| 20 | |
| 21 | virtual ~BrainFlowException () throw () |
| 22 | { |
| 23 | } |
| 24 | |
| 25 | virtual const char *what () const throw () |
| 26 | { |
| 27 | return msg_.c_str (); |
| 28 | } |
| 29 | |
| 30 | protected: |
| 31 | std::string msg_; |
| 32 | }; |
| 33 | |
| 34 | #endif |
no outgoing calls
no test coverage detected