These exceptions can all be caught by const reference.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I11a4f5018c838d77212340efa6f94d5d1c005ed6
try {
the_rotation_thread_handle->unsubscribe_session_consumed_size_rotation(
*session);
- } catch (std::exception& e) {
+ } catch (const std::exception& e) {
/* Continue the destruction of the session anyway. */
ERR("Failed to unsubscribe rotation thread notification channel from consumed size condition during session destruction: %s",
e.what());
try {
the_rotation_thread_handle->subscribe_session_consumed_size_rotation(
*session, new_value);
- } catch (std::exception& e) {
+ } catch (const std::exception& e) {
ERR("Failed to enable consumed-size notification in ROTATION_SET_SCHEDULE command: %s",
e.what());
ret = LTTNG_ERR_UNK;
try {
the_rotation_thread_handle
->unsubscribe_session_consumed_size_rotation(*session);
- } catch (std::exception& e) {
+ } catch (const std::exception& e) {
ERR("Failed to disable consumed-size notification in ROTATION_SET_SCHEDULE command: %s",
e.what());
ret = LTTNG_ERR_UNK;
goto reply;
}
}
- } catch (std::exception& ex) {
+ } catch (const std::exception& ex) {
ERR("Failed to handle application context: %s", ex.what());
ret_code = -EINVAL;
goto reply;
{
try {
return lttng::random::produce_true_random_seed();
- } catch (std::exception& e) {
+ } catch (const std::exception& e) {
WARN("%s",
fmt::format(
"Failed to produce a random seed using getrandom(), falling back to pseudo-random device seed generation which will block until its pool is initialized: {}",
* under some containerized environments.
*/
produce_random_seed_from_urandom();
- } catch (std::exception& e) {
+ } catch (const std::exception& e) {
WARN("%s",
fmt::format("Failed to produce a random seed from the urandom device: {}",
e.what())
if (!lttng_uuid_is_init) {
try {
srand(lttng::random::produce_best_effort_random_seed());
- } catch (std::exception& e) {
+ } catch (const std::exception& e) {
ERR("Failed to initialize random seed during generation of UUID: %s",
e.what());
ret = -1;