Commit 8ca1d84a authored by gabime's avatar gabime

Removed catch(..) from the codebase. Catch only std::exception

parent 63d7c646
...@@ -42,13 +42,6 @@ ...@@ -42,13 +42,6 @@
#define SPDLOG_DEPRECATED #define SPDLOG_DEPRECATED
#endif #endif
#if defined(__linux__) && !defined(__ANDROID__)
#include <cxxabi.h>
#define SPDLOG_CATCH_ALL catch (abi::__forced_unwind&) { _err_handler("Unknown exception"); throw; } catch (...)
#else // __linux__
#define SPDLOG_CATCH_ALL catch (...)
#endif // __linux__
#include "fmt/fmt.h" #include "fmt/fmt.h"
namespace spdlog namespace spdlog
......
...@@ -280,10 +280,6 @@ inline void spdlog::details::async_log_helper::worker_loop() ...@@ -280,10 +280,6 @@ inline void spdlog::details::async_log_helper::worker_loop()
{ {
_err_handler(ex.what()); _err_handler(ex.what());
} }
catch (...)
{
_err_handler("Unknown exception");
}
} }
if (_worker_teardown_cb) _worker_teardown_cb(); if (_worker_teardown_cb) _worker_teardown_cb();
......
...@@ -98,8 +98,4 @@ inline void spdlog::async_logger::_sink_it(details::log_msg& msg) ...@@ -98,8 +98,4 @@ inline void spdlog::async_logger::_sink_it(details::log_msg& msg)
{ {
_err_handler(ex.what()); _err_handler(ex.what());
} }
catch (...)
{
_err_handler("Unknown exception");
}
} }
...@@ -77,10 +77,6 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* fmt, const Ar ...@@ -77,10 +77,6 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* fmt, const Ar
{ {
_err_handler(ex.what()); _err_handler(ex.what());
} }
SPDLOG_CATCH_ALL
{
_err_handler("Unknown exception");
}
} }
template <typename... Args> template <typename... Args>
...@@ -97,11 +93,6 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* msg) ...@@ -97,11 +93,6 @@ inline void spdlog::logger::log(level::level_enum lvl, const char* msg)
{ {
_err_handler(ex.what()); _err_handler(ex.what());
} }
SPDLOG_CATCH_ALL
{
_err_handler("Unknown exception");
}
} }
template<typename T> template<typename T>
...@@ -118,10 +109,6 @@ inline void spdlog::logger::log(level::level_enum lvl, const T& msg) ...@@ -118,10 +109,6 @@ inline void spdlog::logger::log(level::level_enum lvl, const T& msg)
{ {
_err_handler(ex.what()); _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 ...@@ -571,4 +558,3 @@ inline const std::vector<spdlog::sink_ptr>& spdlog::logger::sinks() const
return _sinks; return _sinks;
} }
#undef SPDLOG_CATCH_ALL
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment