#ifndef LIBEDBG_INCLUDE_ERROR_H #define LIBEDBG_INCLUDE_ERROR_H #include #include namespace edbg { class error final : public std::runtime_error { public: [[noreturn]] static void send(const std::string &msg) { throw error(msg); } [[noreturn]] static void send_errno(const std::string &pfx) { throw error(pfx + ": " + std::strerror(errno)); } private: explicit error(const std::string &msg) : std::runtime_error(msg) { } }; } #endif //LIBEDBG_INCLUDE_ERROR_H