Cleanup: rotation-thread: enforce conding standard following fix
[lttng-tools.git] / src / common / exception.hpp
index 30a40347050e8839c210e5bb461540f41186a92f..a3b0a83e210a5246b35e949112eef5a315c79f73 100644 (file)
 
 #include <lttng/lttng-error.h>
 
-#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,14 +49,19 @@ 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);
-       lttng_error_code get_code() const;
+       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
+       {
+               return _error_code;
+       }
 
 private:
-       lttng_error_code _error_code;
+       const lttng_error_code _error_code;
 };
 } /* namespace ctl */
 
This page took 0.031265 seconds and 4 git commands to generate.