63.64% Lines (21/33) 63.64% Functions (7/11)
TLA Baseline Branch
Line Hits Code Line Hits Code
1   // 1   //
2   // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) 2   // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3   // 3   //
4   // Distributed under the Boost Software License, Version 1.0. (See accompanying 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) 5   // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6   // 6   //
7   // Official repository: https://github.com/cppalliance/http 7   // Official repository: https://github.com/cppalliance/http
8   // 8   //
9   9  
10   #include <boost/http/detail/except.hpp> 10   #include <boost/http/detail/except.hpp>
11   #include <boost/system/system_error.hpp> 11   #include <boost/system/system_error.hpp>
12   #include <boost/version.hpp> 12   #include <boost/version.hpp>
13   #include <boost/throw_exception.hpp> 13   #include <boost/throw_exception.hpp>
14   #include <stdexcept> 14   #include <stdexcept>
15   #include <typeinfo> 15   #include <typeinfo>
16   16  
17   namespace boost { 17   namespace boost {
18   namespace http { 18   namespace http {
19   namespace detail { 19   namespace detail {
20   20  
21   void 21   void
MISUBC 22   throw_bad_alloc( 22   throw_bad_alloc(
23   source_location const& loc) 23   source_location const& loc)
24   { 24   {
MISUBC 25   throw_exception( 25   throw_exception(
MISUBC 26   std::bad_alloc(), loc); 26   std::bad_alloc(), loc);
27   } 27   }
28   28  
29   void 29   void
HITCBC 30   1 throw_bad_typeid( 30   1 throw_bad_typeid(
31   source_location const& loc) 31   source_location const& loc)
32   { 32   {
HITCBC 33   1 throw_exception( 33   1 throw_exception(
HITCBC 34   2 std::bad_typeid(), loc); 34   2 std::bad_typeid(), loc);
35   } 35   }
36   36  
37   void 37   void
HITCBC 38   27 throw_invalid_argument( 38   27 throw_invalid_argument(
39   source_location const& loc) 39   source_location const& loc)
40   { 40   {
HITCBC 41   27 throw_exception( 41   27 throw_exception(
HITCBC 42   54 std::invalid_argument( 42   54 std::invalid_argument(
43   "invalid argument"), 43   "invalid argument"),
44   loc); 44   loc);
45   } 45   }
46   46  
47   void 47   void
HITCBC 48   4 throw_invalid_argument( 48   4 throw_invalid_argument(
49   char const* what, 49   char const* what,
50   source_location const& loc) 50   source_location const& loc)
51   { 51   {
HITCBC 52   4 throw_exception( 52   4 throw_exception(
HITCBC 53   8 std::invalid_argument(what), loc); 53   8 std::invalid_argument(what), loc);
54   } 54   }
55   55  
56   void 56   void
HITCBC 57   23 throw_length_error( 57   23 throw_length_error(
58   source_location const& loc) 58   source_location const& loc)
59   { 59   {
HITCBC 60   23 throw_exception( 60   23 throw_exception(
HITCBC 61   46 std::length_error( 61   46 std::length_error(
62   "length error"), loc); 62   "length error"), loc);
63   } 63   }
64   64  
65   void 65   void
HITCBC 66   1 throw_length_error( 66   1 throw_length_error(
67   char const* what, 67   char const* what,
68   source_location const& loc) 68   source_location const& loc)
69   { 69   {
HITCBC 70   1 throw_exception( 70   1 throw_exception(
HITCBC 71   2 std::length_error(what), loc); 71   2 std::length_error(what), loc);
72   } 72   }
73   73  
74   void 74   void
HITCBC 75   21 throw_logic_error( 75   21 throw_logic_error(
76   source_location const& loc) 76   source_location const& loc)
77   { 77   {
HITCBC 78   21 throw_exception( 78   21 throw_exception(
HITCBC 79   42 std::logic_error( 79   42 std::logic_error(
80   "logic error"), 80   "logic error"),
81   loc); 81   loc);
82   } 82   }
83   83  
84   void 84   void
MISUBC 85   throw_out_of_range( 85   throw_out_of_range(
86   source_location const& loc) 86   source_location const& loc)
87   { 87   {
MISUBC 88   throw_exception( 88   throw_exception(
MISUBC 89   std::out_of_range("out of range"), loc); 89   std::out_of_range("out of range"), loc);
90   } 90   }
91   91  
92   void 92   void
MISUBC 93   throw_runtime_error( 93   throw_runtime_error(
94   char const* what, 94   char const* what,
95   source_location const& loc) 95   source_location const& loc)
96   { 96   {
MISUBC 97   throw_exception( 97   throw_exception(
MISUBC 98   std::runtime_error(what), loc); 98   std::runtime_error(what), loc);
99   } 99   }
100   100  
101   void 101   void
HITCBC 102   23 throw_system_error( 102   23 throw_system_error(
103   system::error_code const& ec, 103   system::error_code const& ec,
104   source_location const& loc) 104   source_location const& loc)
105   { 105   {
HITCBC 106   23 throw_exception( 106   23 throw_exception(
HITCBC 107   46 system::system_error(ec), loc); 107   46 system::system_error(ec), loc);
108   } 108   }
109   109  
110   void 110   void
MISUBC 111   throw_system_error( 111   throw_system_error(
112   error e, 112   error e,
113   source_location const& loc) 113   source_location const& loc)
114   { 114   {
MISUBC 115   throw_exception( 115   throw_exception(
MISUBC 116   system::system_error(e), loc); 116   system::system_error(e), loc);
117   } 117   }
118   118  
119   } // detail 119   } // detail
120   } // http 120   } // http
121   } // boost 121   } // boost