All errors derive from this one
| 548 | |
| 549 | /// All errors derive from this one |
| 550 | class Error : public std::runtime_error { |
| 551 | int actual_exit_code; |
| 552 | std::string error_name{"Error"}; |
| 553 | |
| 554 | public: |
| 555 | int get_exit_code() const { return actual_exit_code; } |
| 556 | |
| 557 | std::string get_name() const { return error_name; } |
| 558 | |
| 559 | Error(std::string name, std::string msg, int exit_code = static_cast<int>(ExitCodes::BaseClass)) |
| 560 | : runtime_error(msg), actual_exit_code(exit_code), error_name(std::move(name)) {} |
| 561 | |
| 562 | Error(std::string name, std::string msg, ExitCodes exit_code) : Error(name, msg, static_cast<int>(exit_code)) {} |
| 563 | }; |
| 564 | |
| 565 | // Note: Using Error::Error constructors does not work on GCC 4.7 |
| 566 |
no outgoing calls
no test coverage detected