LCOV - code coverage report
Current view: top level - libs/http_proto/src/detail - except.cpp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 9 30 30.0 %
Date: 2024-04-22 17:18:35 Functions: 3 10 30.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             : #include <boost/http_proto/detail/except.hpp>
      11             : #include <boost/system/system_error.hpp>
      12             : #include <boost/version.hpp>
      13             : #include <boost/throw_exception.hpp>
      14             : #include <stdexcept>
      15             : 
      16             : namespace boost {
      17             : namespace http_proto {
      18             : namespace detail {
      19             : 
      20             : void
      21           0 : throw_bad_alloc(
      22             :     source_location const& loc)
      23             : {
      24           0 :     throw_exception(
      25           0 :         std::bad_alloc(), loc);
      26             : }
      27             : 
      28             : void
      29          12 : throw_invalid_argument(
      30             :     source_location const& loc)
      31             : {
      32          12 :     throw_exception(
      33          24 :         std::invalid_argument(
      34             :             "invalid argument"),
      35             :         loc);
      36             : }
      37             : 
      38             : void
      39           0 : throw_invalid_argument(
      40             :     char const* what,
      41             :     source_location const& loc)
      42             : {
      43           0 :     throw_exception(
      44           0 :         std::invalid_argument(what), loc);
      45             : }
      46             : 
      47             : void
      48          51 : throw_length_error(
      49             :     source_location const& loc)
      50             : {
      51          51 :     throw_exception(
      52         102 :         std::length_error(
      53             :             "length error"), loc);
      54             : }
      55             : 
      56             : void
      57           0 : throw_length_error(
      58             :     char const* what,
      59             :     source_location const& loc)
      60             : {
      61           0 :     throw_exception(
      62           0 :         std::length_error(what), loc);
      63             : }
      64             : 
      65             : void
      66          22 : throw_logic_error(
      67             :     source_location const& loc)
      68             : {
      69          22 :     throw_exception(
      70          44 :         std::logic_error(
      71             :             "logic error"),
      72             :         loc);
      73             : }
      74             : 
      75             : void
      76           0 : throw_out_of_range(
      77             :     source_location const& loc)
      78             : {
      79           0 :     throw_exception(
      80           0 :         std::out_of_range("out of range"), loc);
      81             : }
      82             : 
      83             : void
      84           0 : throw_runtime_error(
      85             :     char const* what,
      86             :     source_location const& loc)
      87             : {
      88           0 :     throw_exception(
      89           0 :         std::runtime_error(what), loc);
      90             : }
      91             : 
      92             : void
      93           0 : throw_system_error(
      94             :     system::error_code const& ec,
      95             :     source_location const& loc)
      96             : {
      97           0 :     throw_exception(
      98           0 :         system::system_error(ec), loc);
      99             : }
     100             : 
     101             : void
     102           0 : throw_system_error(
     103             :     error e,
     104             :     source_location const& loc)
     105             : {
     106           0 :     throw_exception(
     107           0 :         system::system_error(e), loc);
     108             : }
     109             : 
     110             : } // detail
     111             : } // http_proto
     112             : } // boost

Generated by: LCOV version 1.15