forked from libbitcoin/libbitcoin-database
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherror.cpp
More file actions
148 lines (131 loc) · 4.96 KB
/
error.cpp
File metadata and controls
148 lines (131 loc) · 4.96 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/**
* 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/>.
*/
#include <bitcoin/database/error.hpp>
#include <bitcoin/database/define.hpp>
namespace libbitcoin {
namespace database {
namespace error {
DEFINE_ERROR_T_MESSAGE_MAP(error)
{
// general
{ success, "success" },
{ canceled, "canceled" },
{ unknown_state, "unknown state" },
// integrity (internal fault)
{ integrity, "store corrupted" },
{ integrity1, "store corrupted1" },
{ integrity2, "store corrupted2" },
{ integrity3, "store corrupted3" },
{ integrity4, "store corrupted4" },
{ integrity5, "store corrupted5" },
{ integrity6, "store corrupted6" },
{ integrity7, "store corrupted7" },
{ integrity8, "store corrupted8" },
{ integrity9, "store corrupted9" },
////{ integrity10, "store corrupted10" },
// memory map
{ open_open, "opening open file" },
{ size_failure, "filure obtaining file size" },
{ close_loaded, "closing loaded file" },
{ load_loaded, "loading loaded file" },
{ load_locked, "loading locked file" },
{ load_failure, "file failed to load, disk may be full" },
{ reload_unloaded, "reloading unloaded file" },
{ reload_locked, "reloading locked file" },
{ flush_unloaded, "flushing unloaded file" },
{ flush_failure, "file failed to flush" },
{ unload_locked, "unloading locked file" },
{ unload_failure, "file failed to unload" },
// mmap
{ disk_full, "disk full" },
{ mmap_failure, "mmap failure" },
{ mremap_failure, "mremap failure" },
{ munmap_failure, "munmap failure" },
{ madvise_failure, "madvise failure" },
{ sysconf_failure, "sysconf failure" },
{ ftruncate_failure, "ftruncate failure" },
{ fsync_failure, "fsync failure" },
// locks
{ transactor_lock, "transactor lock failure" },
{ process_lock, "process lock failure" },
{ flush_lock, "flush lock failure" },
{ flush_unlock, "flush unlock failure" },
{ process_unlock, "process unlock failure" },
// filesystem
{ missing_directory, "missing directory failure" },
{ clear_directory, "clear directory failure" },
{ rename_directory, "rename directory failure" },
{ copy_directory, "copy directory failure" },
// store
{ not_coalesced, "not coalesced" },
{ missing_snapshot, "missing snapshot" },
{ unloaded_file, "file not loaded" },
// tables
{ create_table, "failed to create table" },
{ close_table, "failed to close table" },
{ prune_table, "failed to prune table" },
{ backup_table, "failed to backup table" },
{ restore_table, "failed to restore table" },
{ verify_table, "failed to verify table" },
// states
{ tx_connected, "transaction connected" },
{ tx_disconnected, "transaction disconnected" },
{ block_valid, "block valid" },
{ block_confirmable, "block confirmable" },
{ block_unconfirmable, "block unconfirmable" },
{ unassociated, "unassociated" },
{ unvalidated, "unvalidated" },
{ bypassed, "bypassed" },
// tx archive
{ tx_empty, "tx_empty" },
{ tx_tx_allocate, "tx_tx_allocate" },
{ tx_input_put, "tx_input_put" },
{ tx_ins_put, "tx_ins_put" },
{ tx_output_put, "tx_output_put" },
{ tx_outs_put, "tx_outs_put" },
{ tx_point_allocate, "tx_point_allocate" },
{ tx_point_put, "tx_point_put" },
{ tx_null_point_put, "tx_null_point_put" },
{ tx_duplicate_put, "tx_duplicate_put" },
{ tx_tx_set, "tx_tx_set" },
{ tx_address_allocate, "tx_address_allocate" },
{ tx_address_put, "tx_address_put" },
{ tx_tx_commit, "tx_tx_commit" },
// header archive
{ header_put, "header_put" },
// txs archive
{ txs_header, "txs_header" },
{ txs_empty, "txs_empty" },
{ txs_height, "txs_height" },
{ txs_confirm, "txs_confirm" },
{ txs_txs_put, "txs_txs_put" },
// services
{ not_found, "not_found" },
{ empty_block, "empty_block" },
{ query_canceled, "query_canceled" },
{ invalid_argument, "invalid_argument" },
{ missing_prevouts, "missing_prevouts" },
{ merkle_proof, "merkle_proof" },
{ merkle_interval, "merkle_interval" },
{ merkle_hashes, "merkle_hashes" }
};
DEFINE_ERROR_T_CATEGORY(error, "database", "database code")
} // namespace error
} // namespace database
} // namespace libbitcoin