LCOV - code coverage report
Current view: top level - http_proto/detail/impl - except.ipp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 6 27 22.2 %
Date: 2023-01-15 07:18:31 Functions: 2 9 22.2 %

          Line data    Source code
       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           0 : throw_bad_alloc(
      24             :     source_location const& loc)
      25             : {
      26           0 :     throw_exception(
      27           0 :         std::bad_alloc(), loc);
      28             : }
      29             : 
      30             : void
      31           0 : throw_invalid_argument(
      32             :     source_location const& loc)
      33             : {
      34           0 :     throw_exception(
      35           0 :         std::invalid_argument(
      36             :             "invalid argument"),
      37             :         loc);
      38             : }
      39             : 
      40             : void
      41           0 : throw_invalid_argument(
      42             :     char const* what,
      43             :     source_location const& loc)
      44             : {
      45           0 :     throw_exception(
      46           0 :         std::invalid_argument(what), loc);
      47             : }
      48             : 
      49             : void
      50           3 : throw_length_error(
      51             :     source_location const& loc)
      52             : {
      53           3 :     throw_exception(
      54           6 :         std::length_error(
      55             :             "length error"), loc);
      56             : }
      57             : 
      58             : void
      59           1 : throw_length_error(
      60             :     char const* what,
      61             :     source_location const& loc)
      62             : {
      63           1 :     throw_exception(
      64           2 :         std::length_error(what), loc);
      65             : }
      66             : 
      67             : void
      68           0 : throw_logic_error(
      69             :     source_location const& loc)
      70             : {
      71           0 :     throw_exception(
      72           0 :         std::logic_error(
      73             :             "logic error"),
      74             :         loc);
      75             : }
      76             : 
      77             : void
      78           0 : throw_out_of_range(
      79             :     source_location const& loc)
      80             : {
      81           0 :     throw_exception(
      82           0 :         std::out_of_range("out of range"), loc);
      83             : }
      84             : 
      85             : void
      86           0 : throw_system_error(
      87             :     error_code const& ec,
      88             :     source_location const& loc)
      89             : {
      90           0 :     throw_exception(
      91           0 :         system_error(ec), loc);
      92             : }
      93             : 
      94             : void
      95           0 : throw_system_error(
      96             :     error e,
      97             :     source_location const& loc)
      98             : {
      99           0 :     throw_exception(
     100           0 :         system_error(e), loc);
     101             : }
     102             : 
     103             : } // detail
     104             : } // http_proto
     105             : } // boost
     106             : 
     107             : #endif

Generated by: LCOV version 1.15