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 30 20.0 %
Date: 2023-03-01 04:29:22 Functions: 2 10 20.0 %

          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/system/system_error.hpp>
      15             : #include <boost/version.hpp>
      16             : #include <boost/throw_exception.hpp>
      17             : #include <stdexcept>
      18             : 
      19             : namespace boost {
      20             : namespace http_proto {
      21             : namespace detail {
      22             : 
      23             : void
      24           0 : throw_bad_alloc(
      25             :     source_location const& loc)
      26             : {
      27           0 :     throw_exception(
      28           0 :         std::bad_alloc(), loc);
      29             : }
      30             : 
      31             : void
      32           4 : throw_invalid_argument(
      33             :     source_location const& loc)
      34             : {
      35           4 :     throw_exception(
      36           8 :         std::invalid_argument(
      37             :             "invalid argument"),
      38             :         loc);
      39             : }
      40             : 
      41             : void
      42           0 : throw_invalid_argument(
      43             :     char const* what,
      44             :     source_location const& loc)
      45             : {
      46           0 :     throw_exception(
      47           0 :         std::invalid_argument(what), loc);
      48             : }
      49             : 
      50             : void
      51           4 : throw_length_error(
      52             :     source_location const& loc)
      53             : {
      54           4 :     throw_exception(
      55           8 :         std::length_error(
      56             :             "length error"), loc);
      57             : }
      58             : 
      59             : void
      60           0 : throw_length_error(
      61             :     char const* what,
      62             :     source_location const& loc)
      63             : {
      64           0 :     throw_exception(
      65           0 :         std::length_error(what), loc);
      66             : }
      67             : 
      68             : void
      69           0 : throw_logic_error(
      70             :     source_location const& loc)
      71             : {
      72           0 :     throw_exception(
      73           0 :         std::logic_error(
      74             :             "logic error"),
      75             :         loc);
      76             : }
      77             : 
      78             : void
      79           0 : throw_out_of_range(
      80             :     source_location const& loc)
      81             : {
      82           0 :     throw_exception(
      83           0 :         std::out_of_range("out of range"), loc);
      84             : }
      85             : 
      86             : void
      87           0 : throw_runtime_error(
      88             :     char const* what,
      89             :     source_location const& loc)
      90             : {
      91           0 :     throw_exception(
      92           0 :         std::runtime_error(what), loc);
      93             : }
      94             : 
      95             : void
      96           0 : throw_system_error(
      97             :     system::error_code const& ec,
      98             :     source_location const& loc)
      99             : {
     100           0 :     throw_exception(
     101           0 :         system::system_error(ec), loc);
     102             : }
     103             : 
     104             : void
     105           0 : throw_system_error(
     106             :     error e,
     107             :     source_location const& loc)
     108             : {
     109           0 :     throw_exception(
     110           0 :         system::system_error(e), loc);
     111             : }
     112             : 
     113             : } // detail
     114             : } // http_proto
     115             : } // boost
     116             : 
     117             : #endif

Generated by: LCOV version 1.15