/src/boost/boost/json/detail/impl/except.ipp
Line | Count | Source (jump to first uncovered line) |
1 | | // |
2 | | // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) |
3 | | // |
4 | | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
5 | | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
6 | | // |
7 | | // Official repository: https://github.com/boostorg/json |
8 | | // |
9 | | |
10 | | #ifndef BOOST_JSON_DETAIL_IMPL_EXCEPT_IPP |
11 | | #define BOOST_JSON_DETAIL_IMPL_EXCEPT_IPP |
12 | | |
13 | | #include <boost/json/detail/except.hpp> |
14 | | #include <boost/version.hpp> |
15 | | #include <boost/throw_exception.hpp> |
16 | | #include <stdexcept> |
17 | | |
18 | | namespace boost { |
19 | | namespace json { |
20 | | |
21 | | namespace detail { |
22 | | |
23 | | void |
24 | | throw_system_error( |
25 | | system::error_code const& ec, |
26 | | source_location const& loc) |
27 | 0 | { |
28 | 0 | throw_exception( |
29 | 0 | system::system_error(ec), |
30 | 0 | loc); |
31 | 0 | } |
32 | | |
33 | | void |
34 | | throw_system_error( |
35 | | error e, |
36 | | source_location const* loc) |
37 | 0 | { |
38 | 0 | system::error_code ec; |
39 | 0 | ec.assign(e, loc); |
40 | |
|
41 | 0 | throw_exception( |
42 | 0 | system::system_error(ec), |
43 | 0 | *loc); |
44 | 0 | } |
45 | | |
46 | | } // detail |
47 | | } // namespace json |
48 | | } // namespace boost |
49 | | |
50 | | #endif |