blob: 9e9107487a8bb394f8b82975fbfa28c8bfc7abc1 [file] [log] [blame]
Ed Tanousf7065512023-05-30 13:00:57 -07001#include "logging.hpp"
2
Patrick Williams89492a12023-05-10 07:51:34 -05003#include <boost/asio/impl/src.hpp>
Ed Tanousf7065512023-05-30 13:00:57 -07004#include <boost/assert/source_location.hpp>
5
6#include <exception>
7
8namespace boost
9{
10void throw_exception(const std::exception& e)
11{
Ed Tanous62598e32023-07-17 17:06:25 -070012 BMCWEB_LOG_CRITICAL("Boost exception thrown {}", e.what());
Ed Tanousf7065512023-05-30 13:00:57 -070013 std::terminate();
14}
15
16void throw_exception(const std::exception& e, const source_location& loc)
17{
Ed Tanous62598e32023-07-17 17:06:25 -070018 BMCWEB_LOG_CRITICAL("Boost exception thrown {} from {}:{}", e.what(),
19 loc.file_name(), loc.line());
Ed Tanousf7065512023-05-30 13:00:57 -070020 std::terminate();
21}
22} // namespace boost