mirror of
https://github.com/gabime/spdlog.git
synced 2025-11-16 09:28:56 +08:00
Removed catch(..) from the codebase. Catch only std::exception
This commit is contained in:
@@ -279,11 +279,7 @@ inline void spdlog::details::async_log_helper::worker_loop()
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
_err_handler(ex.what());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
_err_handler("Unknown exception");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_worker_teardown_cb) _worker_teardown_cb();
|
||||
|
||||
|
||||
@@ -97,9 +97,5 @@ inline void spdlog::async_logger::_sink_it(details::log_msg& msg)
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
_err_handler(ex.what());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
_err_handler("Unknown exception");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,11 +76,7 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* fmt, const Ar
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
_err_handler(ex.what());
|
||||
}
|
||||
SPDLOG_CATCH_ALL
|
||||
{
|
||||
_err_handler("Unknown exception");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
@@ -96,12 +92,7 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* msg)
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
_err_handler(ex.what());
|
||||
}
|
||||
SPDLOG_CATCH_ALL
|
||||
{
|
||||
_err_handler("Unknown exception");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -117,11 +108,7 @@ inline void spdlog::logger::log(level::level_enum lvl, const T& msg)
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
_err_handler(ex.what());
|
||||
}
|
||||
SPDLOG_CATCH_ALL
|
||||
{
|
||||
_err_handler("Unknown exception");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -571,4 +558,3 @@ inline const std::vector<spdlog::sink_ptr>& spdlog::logger::sinks() const
|
||||
return _sinks;
|
||||
}
|
||||
|
||||
#undef SPDLOG_CATCH_ALL
|
||||
|
||||
Reference in New Issue
Block a user