xref: /openbmc/bmcweb/src/boost_asio.cpp (revision d2ec1bd7a0267cfd259615b979a4a2119f09a7d6)
1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors
3 #include "logging.hpp"
4 
5 #include <boost/asio/impl/src.hpp>
6 #include <boost/assert/source_location.hpp>
7 
8 #include <exception>
9 
10 namespace boost
11 {
12 void throw_exception(const std::exception& e)
13 {
14     BMCWEB_LOG_CRITICAL("Boost exception thrown {}", e.what());
15     std::terminate();
16 }
17 
18 void throw_exception(const std::exception& e, const source_location& loc)
19 {
20     BMCWEB_LOG_CRITICAL("Boost exception thrown {} from {}:{}", e.what(),
21                         loc.file_name(), loc.line());
22     std::terminate();
23 }
24 } // namespace boost
25