X-Git-Url: https://git.liburcu.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fexception.hpp;h=b223799151508c5a5a51d37628db093aca9bc6d6;hp=20731c06aa4419f18daac0c2ff5a0622990cb559;hb=aeeb48c6a7dd4bcc092b3105439489fc393f6425;hpb=3130a40c184a9315f0a4ca9a235273277fdcabde diff --git a/src/common/exception.hpp b/src/common/exception.hpp index 20731c06a..b22379915 100644 --- a/src/common/exception.hpp +++ b/src/common/exception.hpp @@ -18,6 +18,8 @@ throw lttng::ctl::error(msg, error_code, __FILE__, __func__, __LINE__) #define LTTNG_THROW_POSIX(msg, errno_code) \ throw lttng::posix_error(msg, errno_code, __FILE__, __func__, __LINE__) +#define LTTNG_THROW_ERROR(msg) \ + throw lttng::runtime_error(msg, __FILE__, __func__, __LINE__) namespace lttng { @@ -45,6 +47,14 @@ public: unsigned int line_number); }; +class runtime_error : public std::runtime_error { +public: + explicit runtime_error(const std::string &msg, + const char *file_name, + const char *function_name, + unsigned int line_number); +}; + }; /* namespace lttng */ #endif /* LTTNG_EXCEPTION_H_ */