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