Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:39

0001 //
0002 // Copyright (c) 2019-2023 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 
0008 #ifndef BOOST_MYSQL_DETAIL_THROW_ON_ERROR_LOC_HPP
0009 #define BOOST_MYSQL_DETAIL_THROW_ON_ERROR_LOC_HPP
0010 
0011 #include <boost/mysql/diagnostics.hpp>
0012 #include <boost/mysql/error_code.hpp>
0013 #include <boost/mysql/error_with_diagnostics.hpp>
0014 
0015 #include <boost/assert/source_location.hpp>
0016 
0017 namespace boost {
0018 namespace mysql {
0019 namespace detail {
0020 
0021 inline void throw_on_error_loc(error_code err, const diagnostics& diag, const boost::source_location& loc)
0022 {
0023     if (err)
0024     {
0025         ::boost::throw_exception(error_with_diagnostics(err, diag), loc);
0026     }
0027 }
0028 
0029 }  // namespace detail
0030 }  // namespace mysql
0031 }  // namespace boost
0032 
0033 #endif