cpp-common/bt2c: optionally log and append errors in `dataFromFile()`
For some callers, a `dataFromFile()` error (`NoSuchFileOrDirectoryError`
typically) may be fatal, in which case it would be appropriate to log an
error and append an error cause. For others callers, it might not be
fatal, they just want to catch the exception and carry on.
To accomodate this, pass a logger to `dataFromFile()` and add a
`fatalError` boolean parameter. Log an error and append an error cause
on error if `fatalError` is true. Otherwise, log at the debug level.
Change-Id: Id32639b16a928195bc430c1a2ce7671ced2ad43b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12738
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.024001 seconds and 4 git commands to generate.