implement attach and launch
This commit is contained in:
26
include/libedbg/error.hpp
Normal file
26
include/libedbg/error.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef LIBEDBG_INCLUDE_ERROR_H
|
||||
#define LIBEDBG_INCLUDE_ERROR_H
|
||||
|
||||
#include <stdexcept>
|
||||
#include <cstring>
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user