blob: 477b9e48a8294bdf0c2bf85094d844f3d6bc341a [file] [log] [blame]
Ed Tanous40e9b922024-09-10 13:50:16 -07001// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright OpenBMC Authors
Ed Tanousf7065512023-05-30 13:00:57 -07003#include "logging.hpp"
4
Patrick Williams89492a12023-05-10 07:51:34 -05005#include <boost/asio/impl/src.hpp>
Ed Tanousf7065512023-05-30 13:00:57 -07006#include <boost/assert/source_location.hpp>
7
8#include <exception>
9
10namespace boost
11{
12void throw_exception(const std::exception& e)
13{
Ed Tanous62598e32023-07-17 17:06:25 -070014 BMCWEB_LOG_CRITICAL("Boost exception thrown {}", e.what());
Ed Tanousf7065512023-05-30 13:00:57 -070015 std::terminate();
16}
17
18void throw_exception(const std::exception& e, const source_location& loc)
19{
Ed Tanous62598e32023-07-17 17:06:25 -070020 BMCWEB_LOG_CRITICAL("Boost exception thrown {} from {}:{}", e.what(),
21 loc.file_name(), loc.line());
Ed Tanousf7065512023-05-30 13:00:57 -070022 std::terminate();
23}
24} // namespace boost