Skip to content

Commit

Permalink
Remove inner try catch in SPDLOG_LOGGER_CATCH
Browse files Browse the repository at this point in the history
The fmt::format call should not throw formatting the exception message and the source code location.
  • Loading branch information
D-r-P-3-p-p-3-r committed Aug 17, 2021
1 parent ed27592 commit 0d10e21
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions include/spdlog/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@
{ \
if(location.filename) \
{ \
try \
{ \
err_handler_(fmt::format("{} [{}({})]", ex.what(), location.filename, location.line)); \
} \
catch (const std::exception &ex) \
{ \
err_handler_(ex.what()); \
} \
err_handler_(fmt::format("{} [{}({})]", ex.what(), location.filename, location.line)); \
} \
else \
{ \
Expand Down

0 comments on commit 0d10e21

Please sign in to comment.