libs/corosio/src/corosio/src/detail/except.cpp
75.0% Lines (6/8)
75.0% Functions (3/4)
75.0% Branches (3/4)
libs/corosio/src/corosio/src/detail/except.cpp
| Line | Branch | Hits | Source Code |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2025 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/corosio | ||
| 8 | // | ||
| 9 | |||
| 10 | #include <boost/corosio/detail/except.hpp> | ||
| 11 | #include <stdexcept> | ||
| 12 | |||
| 13 | namespace boost::corosio::detail { | ||
| 14 | |||
| 15 | ✗ | void throw_logic_error() | |
| 16 | { | ||
| 17 | ✗ | throw std::logic_error("logic error"); | |
| 18 | } | ||
| 19 | |||
| 20 | 6 | void throw_logic_error(char const* what) | |
| 21 | { | ||
| 22 |
1/1✓ Branch 2 taken 6 times.
|
6 | throw std::logic_error(what); |
| 23 | } | ||
| 24 | |||
| 25 | 15 | void throw_system_error(std::error_code const& ec) | |
| 26 | { | ||
| 27 |
1/1✓ Branch 2 taken 15 times.
|
15 | throw std::system_error(ec); |
| 28 | } | ||
| 29 | |||
| 30 | 2 | void throw_system_error( | |
| 31 | std::error_code const& ec, | ||
| 32 | char const* what) | ||
| 33 | { | ||
| 34 |
1/1✓ Branch 2 taken 2 times.
|
2 | throw std::system_error(ec, what); |
| 35 | } | ||
| 36 | |||
| 37 | } // namespace boost::corosio::detail | ||
| 38 |