#define _LGPL_SOURCE
#include "../command.hpp"
+#include "../exception.hpp"
#include "../utils.hpp"
#include <common/exception.hpp>
const int ret = lttng_start_tracing(session_name);
if (ret < 0) {
- LTTNG_THROW_CTL(fmt::format("Failed to start session `{}`", session_name),
+ LTTNG_THROW_CTL(lttng::format("Failed to start session `{}`", session_name),
static_cast<lttng_error_code>(-ret));
}
lttng_strerror(-ctl_exception.code()));
listing_failed = true;
return {};
+ } catch (const lttng::cli::no_default_session_error& cli_exception) {
+ /*
+ * The retrieval of the default session name already logs
+ * an error when it fails. There is no value in printing
+ * anything about this exception.
+ */
+ listing_failed = true;
+ return {};
}
}();