ctf: add try/catch at entry points
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 12 Dec 2023 04:17:44 +0000 (04:17 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
commit1e690349e56f6aed18afca0730159a6c374171c6
treee75bbcb781dce730063dd598b4691184fba18dc2
parent35fbda93735515c5f07909a96f2d96f6ebaefabb
ctf: add try/catch at entry points

Add try / catch at the entry points of the CTF component classes to
convert thrown exceptions in the proper statuses.  The handled
exceptions are:

 - std::bad_alloc: converted to MEMORY_ERROR
 - bt2::Error: converted to ERROR

Any other exception (for example, coming from a third-party library we
would eventually use) should be caught and converted to a
bt2_common::Error.

Change-Id: I06c2ccb43947f5a9e61568967f2812ccb0821b36
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12263
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/fs-sink/fs-sink.cpp
src/plugins/ctf/fs-src/fs.cpp
src/plugins/ctf/lttng-live/lttng-live.cpp
This page took 0.024082 seconds and 4 git commands to generate.