X-Git-Url: http://git.liburcu.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fexception.hpp;fp=src%2Fbin%2Flttng%2Fexception.hpp;h=00448f92eb3ab488dc36c6e0ece267407f363e9f;hp=0000000000000000000000000000000000000000;hb=e1b89bf00b15f64523d24cf3e652cdc706d38843;hpb=55769eb50c02a6e630f9acb18c09306e97b64443 diff --git a/src/bin/lttng/exception.hpp b/src/bin/lttng/exception.hpp new file mode 100644 index 000000000..00448f92e --- /dev/null +++ b/src/bin/lttng/exception.hpp @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2024 Jérémie Galarneau + * + * SPDX-License-Identifier: LGPL-2.1-only + * + */ + +#ifndef LTTNG_CLI_EXCEPTION_H +#define LTTNG_CLI_EXCEPTION_H + +#include + +#include + +#include +#include + +#define LTTNG_THROW_CLI_NO_DEFAULT_SESSION() \ + throw lttng::cli::no_default_session_error(__FILE__, __func__, __LINE__) + +namespace lttng { +namespace cli { +class no_default_session_error : public runtime_error { +public: + explicit no_default_session_error(const char *file_name, + const char *function_name, + unsigned int line_number); +}; +} /* namespace cli */ +}; /* namespace lttng */ + +#endif /* LTTNG_CLI_EXCEPTION_H */