Fix: lttng-destroy: string formating error when default session is unset
[lttng-tools.git] / src / bin / lttng / exception.cpp
diff --git a/src/bin/lttng/exception.cpp b/src/bin/lttng/exception.cpp
new file mode 100644 (file)
index 0000000..8995d5e
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+
+#include "exception.hpp"
+
+#include <common/format.hpp>
+#include <common/utils.hpp>
+
+#include <sstream>
+
+lttng::cli::no_default_session_error::no_default_session_error(const char *file_name,
+                                                              const char *function_name,
+                                                              unsigned int line_number) :
+       runtime_error(lttng::format("No default session found in `{}/.lttngrc`",
+                                   utils_get_home_dir() ?: "LTTNG_HOME"),
+                     file_name,
+                     function_name,
+                     line_number)
+{
+}
This page took 0.022973 seconds and 4 git commands to generate.