forked from libbitcoin/libbitcoin-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.hpp
More file actions
113 lines (100 loc) · 2.52 KB
/
error.hpp
File metadata and controls
113 lines (100 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* Copyright (c) 2011-2026 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NODE_ERROR_HPP
#define LIBBITCOIN_NODE_ERROR_HPP
#include <bitcoin/system.hpp>
#include <bitcoin/node/version.hpp>
namespace libbitcoin {
namespace node {
/// Alias system code.
/// std::error_code "node" category holds node::error::error_t.
typedef std::error_code code;
namespace error {
/// Asio failures are normalized to the error codes below.
/// Stop by explicit call is mapped to channel_stopped or service_stopped
/// depending on the context. Asio errors returned on cancel calls are ignored.
enum error_t : uint8_t
{
/// general
success,
/// database
store_uninitialized,
store_reload,
store_prune,
store_snapshot,
/// network
slow_channel,
stalled_channel,
exhausted_channel,
sacrificed_channel,
suspended_channel,
suspended_service,
/// blockchain
orphan_block,
orphan_header,
duplicate_block,
duplicate_header,
/// faults (terminal, code error and store corruption assumed)
protocol1,
protocol2,
header1,
organize1,
organize2,
organize3,
organize4,
organize5,
organize6,
organize7,
organize8,
organize9,
organize10,
organize11,
organize12,
organize13,
organize14,
organize15,
validate1,
validate2,
validate3,
validate4,
validate5,
validate6,
validate7,
validate8,
confirm1,
confirm2,
confirm3,
confirm4,
confirm5,
confirm6,
confirm7,
confirm8,
confirm9,
confirm10,
confirm11,
confirm12,
confirm13
};
// No current need for error_code equivalence mapping.
DECLARE_ERROR_T_CODE_CATEGORY(error);
} // namespace error
} // namespace node
} // namespace libbitcoin
DECLARE_STD_ERROR_REGISTRATION(bc::node::error::error)
#endif