Wrap calls to fmt::format to catch formatting exceptions
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 8 Jun 2023 18:53:15 +0000 (14:53 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 8 Jun 2023 19:18:08 +0000 (15:18 -0400)
commitf9a4135756da1947c2aa00e5b1e3c8e572d02107
tree98d0b598c85a5c329900627986382786f80d7927
parentd5ed3e6f3a8b52d7f2a3e2277873e0f1914ba515
Wrap calls to fmt::format to catch formatting exceptions

fmt::format throws when a formatting error is encountered.
Unfortunately, we can't ensure complete coverage of all logging call
sites (e.g. error paths) and it is not desirable for such an exception
to be thrown in those cases.

The formatting error is returned as the formatted string so that it ends
up in the logs or exception messages more or less transparently.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I1cb33a5fe87221139eaf9de918b47e0397daa89c
18 files changed:
src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp
src/bin/lttng-sessiond/field.cpp
src/bin/lttng-sessiond/field.hpp
src/bin/lttng-sessiond/rotation-thread.cpp
src/bin/lttng-sessiond/tsdl-trace-class-visitor.cpp
src/bin/lttng-sessiond/ust-app.cpp
src/bin/lttng-sessiond/ust-field-convert.cpp
src/bin/lttng-sessiond/ust-registry-channel.cpp
src/bin/lttng-sessiond/ust-registry-session.cpp
src/bin/lttng/commands/destroy.cpp
src/bin/lttng/commands/start.cpp
src/bin/lttng/commands/stop.cpp
src/common/container-wrapper.hpp
src/common/error.hpp
src/common/eventfd.cpp
src/common/file-descriptor.cpp
src/common/format.hpp
src/common/random.cpp
This page took 0.032834 seconds and 4 git commands to generate.