Add basic exception types and throwing facilities
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 29 Apr 2022 19:43:14 +0000 (15:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 13 Jun 2022 20:34:46 +0000 (16:34 -0400)
Add two LTTng-specific exception types:
  - lttng::ctl::error
  - lttng::posix_error

These types are meant to help transition from error code-based
error handling in RAII-safe functions.

lttng::ctl::error wraps `enum lttng_error_code`. It is meant to be
thrown using the `LTTNG_THROW_CTL` macro which samples the throw-site
(file name, function name, line number). This should be used only
in code paths dealing providing the liblttng-ctl interface.

It should, ultimately, be thrown in code that is specific to the
implementation of the various liblttng-ctl commands and not all over the
place since it contains very little information beyond the error code.

lttng::posix_error wraps `errno` values that are used in various places
to report errors involving (mostly) syscalls.

Over time, more specific exception types will be added.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I02e104f28dd8149aee70211b5849f3502f16d58b


No differences found
This page took 0.036958 seconds and 4 git commands to generate.