refactor: session: provide an iterator over consumer data channel keys
[lttng-tools.git] / src / common / exception.hpp
index 340231734d3620b113f622ab7879c7b1bac5bae2..6c926b62f0796c70fecff55ca70d5d4891a2b749 100644 (file)
@@ -22,7 +22,8 @@
        throw lttng::ctl::error(msg, error_code, LTTNG_SOURCE_LOCATION())
 #define LTTNG_THROW_POSIX(msg, errno_code) \
        throw lttng::posix_error(msg, errno_code, LTTNG_SOURCE_LOCATION())
-#define LTTNG_THROW_ERROR(msg) throw lttng::runtime_error(msg, LTTNG_SOURCE_LOCATION())
+#define LTTNG_THROW_ERROR(msg)       throw lttng::runtime_error(msg, LTTNG_SOURCE_LOCATION())
+#define LTTNG_THROW_OUT_OF_RANGE(msg) throw lttng::out_of_range(msg, LTTNG_SOURCE_LOCATION())
 #define LTTNG_THROW_ALLOCATION_FAILURE_ERROR(msg, allocation_size) \
        throw lttng::allocation_failure(msg, allocation_size, LTTNG_SOURCE_LOCATION())
 #define LTTNG_THROW_UNSUPPORTED_ERROR(msg) \
@@ -110,6 +111,19 @@ public:
        std::size_t allocation_size;
 };
 
+/**
+ * @class out_of_range
+ * @brief Represents an out of range access error.
+ *
+ * Thrown when attempting to access a container out of its valid range (e.g., advancing an iterator
+ * past end()).
+ */
+class out_of_range : public lttng::runtime_error {
+public:
+       explicit out_of_range(const std::string& msg,
+                             const lttng::source_location& source_location);
+};
+
 /**
  * @class unsupported_error
  * @brief Represents an error for unsupported features.
This page took 0.024534 seconds and 4 git commands to generate.