GCC Code Coverage Report


Directory: libs/http_proto/include/boost/http_proto/
File: boost/http_proto/detail/impl/except.ipp
Date: 2023-01-09 16:11:13
Exec Total Coverage
Lines: 3 18 16.7%
Functions: 1 6 16.7%
Branches: 0 2 0.0%

Line Branch Exec Source
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/CPPAlliance/http_proto
8 //
9
10 #ifndef BOOST_HTTP_PROTO_DETAIL_IMPL_EXCEPT_IPP
11 #define BOOST_HTTP_PROTO_DETAIL_IMPL_EXCEPT_IPP
12
13 #include <boost/http_proto/detail/except.hpp>
14 #include <boost/version.hpp>
15 #include <boost/throw_exception.hpp>
16 #include <stdexcept>
17
18 namespace boost {
19 namespace http_proto {
20 namespace detail {
21
22 void
23 throw_bad_alloc(
24 source_location const& loc)
25 {
26 throw_exception(
27 std::bad_alloc(), loc);
28 }
29
30 void
31 4 throw_length_error(
32 char const* what,
33 source_location const& loc)
34 {
35 4 throw_exception(
36 8 std::length_error(what), loc);
37 }
38
39 void
40 throw_invalid_argument(
41 char const* what,
42 source_location const& loc)
43 {
44 throw_exception(
45 std::invalid_argument(what), loc);
46 }
47
48 void
49 throw_out_of_range(
50 source_location const& loc)
51 {
52 throw_exception(
53 std::out_of_range("out of range"), loc);
54 }
55
56 void
57 throw_system_error(
58 error_code const& ec,
59 source_location const& loc)
60 {
61 throw_exception(
62 system_error(ec), loc);
63 }
64
65 void
66 throw_system_error(
67 error e,
68 source_location const& loc)
69 {
70 throw_exception(
71 system_error(e), loc);
72 }
73
74 } // detail
75 } // http_proto
76 } // boost
77
78 #endif
79