X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fexception.hpp;h=a3b0a83e210a5246b35e949112eef5a315c79f73;hb=0038180de36c422cfaeade1145fa9fbc9436b8ad;hp=1efd80359654bb34de8af78708a131cd8b194db2;hpb=8b75cd779ffe332281fec189cdf808e4ee452572;p=lttng-tools.git diff --git a/src/common/exception.hpp b/src/common/exception.hpp index 1efd80359..a3b0a83e2 100644 --- a/src/common/exception.hpp +++ b/src/common/exception.hpp @@ -14,12 +14,11 @@ #include -#define LTTNG_THROW_CTL(error_code) \ +#define LTTNG_THROW_CTL(msg, error_code) \ 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__) +#define LTTNG_THROW_ERROR(msg) throw lttng::runtime_error(msg, __FILE__, __func__, __LINE__) #define LTTNG_THROW_UNSUPPORTED_ERROR(msg) \ throw lttng::runtime_error(msg, __FILE__, __func__, __LINE__) #define LTTNG_THROW_COMMUNICATION_ERROR(msg) \ @@ -50,10 +49,11 @@ namespace ctl { /* Wrap lttng_error_code errors which may be reported through liblttng-ctl's interface. */ class error : public runtime_error { public: - explicit error(lttng_error_code error_code, - const char *file_name, - const char *function_name, - unsigned int line_number); + explicit error(const std::string& msg, + lttng_error_code error_code, + const char *file_name, + const char *function_name, + unsigned int line_number); lttng_error_code code() const noexcept {