| 1 |
|
|
1 |
|
|
| 2 |
|
// Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com)
|
2 |
|
// Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com)
|
| 3 |
|
|
3 |
|
|
| 4 |
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
5 |
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
| 6 |
|
|
6 |
|
|
| 7 |
|
// Official repository: https://github.com/cppalliance/capy
|
7 |
|
// Official repository: https://github.com/cppalliance/capy
|
| 8 |
|
|
8 |
|
|
| 9 |
|
|
9 |
|
|
| 10 |
|
#ifndef BOOST_CAPY_ERROR_HPP
|
10 |
|
#ifndef BOOST_CAPY_ERROR_HPP
|
| 11 |
|
#define BOOST_CAPY_ERROR_HPP
|
11 |
|
#define BOOST_CAPY_ERROR_HPP
|
| 12 |
|
|
12 |
|
|
| 13 |
|
#include <boost/capy/detail/config.hpp>
|
13 |
|
#include <boost/capy/detail/config.hpp>
|
| 14 |
|
|
14 |
|
|
| 15 |
|
|
15 |
|
|
| 16 |
|
|
16 |
|
|
| 17 |
|
|
17 |
|
|
| 18 |
|
|
18 |
|
|
| 19 |
|
/** Error codes for capy I/O operations.
|
19 |
|
/** Error codes for capy I/O operations.
|
| 20 |
|
|
20 |
|
|
| 21 |
|
These codes are produced by capy algorithms and I/O operations.
|
21 |
|
These codes are produced by capy algorithms and I/O operations.
|
| 22 |
|
|
22 |
|
|
| 23 |
|
@warning Callers must never compare received `error_code` values
|
23 |
|
@warning Callers must never compare received `error_code` values
|
| 24 |
|
directly against this enum. Always compare against the portable
|
24 |
|
directly against this enum. Always compare against the portable
|
| 25 |
|
@ref cond error conditions instead. These enum values are
|
25 |
|
@ref cond error conditions instead. These enum values are
|
| 26 |
|
implementation details subject to change.
|
26 |
|
implementation details subject to change.
|
| 27 |
|
|
27 |
|
|
| 28 |
|
|
28 |
|
|
| 29 |
|
|
29 |
|
|
| 30 |
|
|
30 |
|
|
| 31 |
|
|
31 |
|
|
| 32 |
|
/// End-of-stream reached. Compare with `cond::eof`.
|
32 |
|
/// End-of-stream reached. Compare with `cond::eof`.
|
| 33 |
|
|
33 |
|
|
| 34 |
|
|
34 |
|
|
| 35 |
|
/// Operation was cancelled. Compare with `cond::canceled`.
|
35 |
|
/// Operation was cancelled. Compare with `cond::canceled`.
|
| 36 |
|
|
36 |
|
|
| 37 |
|
|
37 |
|
|
| 38 |
|
/// Internal test assertion failed.
|
38 |
|
/// Internal test assertion failed.
|
| 39 |
|
|
39 |
|
|
| 40 |
|
|
40 |
|
|
| 41 |
|
/// Peer closed connection without proper TLS shutdown.
|
41 |
|
/// Peer closed connection without proper TLS shutdown.
|
| 42 |
|
/// Compare with `cond::stream_truncated`.
|
42 |
|
/// Compare with `cond::stream_truncated`.
|
| 43 |
|
|
43 |
|
|
| 44 |
|
|
44 |
|
|
| 45 |
|
/// Requested item was not found. Compare with `cond::not_found`.
|
45 |
|
/// Requested item was not found. Compare with `cond::not_found`.
|
| 46 |
|
|
46 |
|
|
| 47 |
|
|
47 |
|
|
| 48 |
|
|
48 |
|
|
| 49 |
|
//-----------------------------------------------
|
49 |
|
//-----------------------------------------------
|
| 50 |
|
|
50 |
|
|
| 51 |
|
|
51 |
|
|
| 52 |
|
|
52 |
|
|
| 53 |
|
|
53 |
|
|
| 54 |
|
|
54 |
|
|
| 55 |
|
|
55 |
|
|
| 56 |
|
struct is_error_code_enum<
|
56 |
|
struct is_error_code_enum<
|
| 57 |
|
|
57 |
|
|
| 58 |
|
|
58 |
|
|
| 59 |
|
|
59 |
|
|
| 60 |
|
|
60 |
|
|
| 61 |
|
|
61 |
|
|
| 62 |
|
|
62 |
|
|
| 63 |
|
|
63 |
|
|
| 64 |
|
//-----------------------------------------------
|
64 |
|
//-----------------------------------------------
|
| 65 |
|
|
65 |
|
|
| 66 |
|
|
66 |
|
|
| 67 |
|
|
67 |
|
|
| 68 |
|
struct BOOST_CAPY_SYMBOL_VISIBLE
|
68 |
|
struct BOOST_CAPY_SYMBOL_VISIBLE
|
| 69 |
|
|
69 |
|
|
| 70 |
|
|
70 |
|
|
| 71 |
|
|
71 |
|
|
| 72 |
|
BOOST_CAPY_DECL const char* name(
|
72 |
|
BOOST_CAPY_DECL const char* name(
|
| 73 |
|
) const noexcept override;
|
73 |
|
) const noexcept override;
|
| 74 |
|
BOOST_CAPY_DECL std::string message(
|
74 |
|
BOOST_CAPY_DECL std::string message(
|
| 75 |
|
|
75 |
|
|
| 76 |
|
constexpr error_cat_type() noexcept = default;
|
76 |
|
constexpr error_cat_type() noexcept = default;
|
| 77 |
|
|
77 |
|
|
| 78 |
|
|
78 |
|
|
| 79 |
|
BOOST_CAPY_DECL extern error_cat_type error_cat;
|
79 |
|
BOOST_CAPY_DECL extern error_cat_type error_cat;
|
| 80 |
|
|
80 |
|
|
| 81 |
|
|
81 |
|
|
| 82 |
|
|
82 |
|
|
| 83 |
|
//-----------------------------------------------
|
83 |
|
//-----------------------------------------------
|
| 84 |
|
|
84 |
|
|
| 85 |
|
|
85 |
|
|
| 86 |
|
|
86 |
|
|
| 87 |
|
|
87 |
|
|
| 88 |
|
|
88 |
|
|
| 89 |
|
|
89 |
|
|
| 90 |
|
|
90 |
|
|
| 91 |
|
static_cast<std::underlying_type<
|
91 |
|
static_cast<std::underlying_type<
|
| 92 |
|
|
92 |
|
|
| 93 |
|
|
93 |
|
|
| 94 |
|
|
94 |
|
|
| 95 |
|
|
95 |
|
|
| 96 |
|
|
96 |
|
|
| 97 |
|
|
97 |
|
|
| 98 |
|
|
98 |
|
|
| 99 |
|
|
99 |
|
|