xref: /openbmc/bmcweb/src/boost_asio.cpp (revision 40e9b92ec19acffb46f83a6e55b18974da5d708e)
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 {
throw_exception(const std::exception & e)12 void throw_exception(const std::exception& e)
13 {
14     BMCWEB_LOG_CRITICAL("Boost exception thrown {}", e.what());
15     std::terminate();
16 }
17 
throw_exception(const std::exception & e,const source_location & loc)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