Ethereum  PoC-8
The C++ Implementation of Ethereum
Exceptions.h
Go to the documentation of this file.
1 /*
2  This file is part of cpp-ethereum.
3 
4  cpp-ethereum is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  cpp-ethereum is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16 */
22 #pragma once
23 
24 #include <libdevcore/Exceptions.h>
25 #include "Common.h"
26 
27 namespace dev
28 {
29 namespace eth
30 {
31 
32 // information to add to exceptions
33 using errinfo_name = boost::error_info<struct tag_field, std::string>;
34 using errinfo_field = boost::error_info<struct tag_field, int>;
35 using errinfo_data = boost::error_info<struct tag_data, std::string>;
36 using errinfo_nonce = boost::error_info<struct tag_nonce, h64>;
37 using errinfo_difficulty = boost::error_info<struct tag_difficulty, u256>;
38 using errinfo_target = boost::error_info<struct tag_target, h256>;
39 using errinfo_seedHash = boost::error_info<struct tag_seedHash, h256>;
40 using errinfo_mixHash = boost::error_info<struct tag_mixHash, h256>;
41 using errinfo_ethashResult = boost::error_info<struct tag_ethashResult, std::tuple<h256, h256>>;
42 using errinfo_importResult = boost::error_info<struct tag_importResult, ImportResult>;
43 using BadFieldError = boost::tuple<errinfo_field, errinfo_data>;
44 
45 DEV_SIMPLE_EXCEPTION(OutOfGasBase);
46 DEV_SIMPLE_EXCEPTION(OutOfGasIntrinsic);
47 DEV_SIMPLE_EXCEPTION(NotEnoughAvailableSpace);
48 DEV_SIMPLE_EXCEPTION(NotEnoughCash);
49 DEV_SIMPLE_EXCEPTION(GasPriceTooLow);
50 DEV_SIMPLE_EXCEPTION(BlockGasLimitReached);
51 DEV_SIMPLE_EXCEPTION(FeeTooSmall);
52 DEV_SIMPLE_EXCEPTION(TooMuchGasUsed);
53 DEV_SIMPLE_EXCEPTION(ExtraDataTooBig);
54 DEV_SIMPLE_EXCEPTION(ExtraDataIncorrect);
55 DEV_SIMPLE_EXCEPTION(TransactionIsUnsigned);
56 DEV_SIMPLE_EXCEPTION(InvalidSignature);
57 DEV_SIMPLE_EXCEPTION(InvalidTransactionFormat);
58 DEV_SIMPLE_EXCEPTION(InvalidBlockFormat);
59 DEV_SIMPLE_EXCEPTION(InvalidUnclesHash);
60 DEV_SIMPLE_EXCEPTION(TooManyUncles);
61 DEV_SIMPLE_EXCEPTION(UncleTooOld);
62 DEV_SIMPLE_EXCEPTION(UncleIsBrother);
63 DEV_SIMPLE_EXCEPTION(UncleInChain);
64 DEV_SIMPLE_EXCEPTION(UncleParentNotInChain);
65 DEV_SIMPLE_EXCEPTION(InvalidStateRoot);
66 DEV_SIMPLE_EXCEPTION(InvalidGasUsed);
67 DEV_SIMPLE_EXCEPTION(InvalidTransactionsRoot);
68 DEV_SIMPLE_EXCEPTION(InvalidDifficulty);
69 DEV_SIMPLE_EXCEPTION(InvalidGasLimit);
70 DEV_SIMPLE_EXCEPTION(InvalidReceiptsStateRoot);
71 DEV_SIMPLE_EXCEPTION(InvalidTimestamp);
72 DEV_SIMPLE_EXCEPTION(InvalidLogBloom);
73 DEV_SIMPLE_EXCEPTION(InvalidNonce);
74 DEV_SIMPLE_EXCEPTION(InvalidBlockHeaderItemCount);
75 DEV_SIMPLE_EXCEPTION(InvalidBlockNonce);
76 DEV_SIMPLE_EXCEPTION(InvalidParentHash);
77 DEV_SIMPLE_EXCEPTION(InvalidUncleParentHash);
78 DEV_SIMPLE_EXCEPTION(InvalidNumber);
79 DEV_SIMPLE_EXCEPTION(InvalidZeroSignatureTransaction);
80 DEV_SIMPLE_EXCEPTION(InvalidTransactionReceiptFormat);
81 DEV_SIMPLE_EXCEPTION(TransactionReceiptVersionError);
82 DEV_SIMPLE_EXCEPTION(PendingTransactionAlreadyExists);
83 DEV_SIMPLE_EXCEPTION(TransactionAlreadyInChain);
84 DEV_SIMPLE_EXCEPTION(BlockNotFound);
85 DEV_SIMPLE_EXCEPTION(UnknownParent);
86 DEV_SIMPLE_EXCEPTION(AddressAlreadyUsed);
87 DEV_SIMPLE_EXCEPTION(ZeroSignatureTransaction);
88 DEV_SIMPLE_EXCEPTION(UnknownTransactionValidationError);
89 DEV_SIMPLE_EXCEPTION(UnknownError);
90 
91 DEV_SIMPLE_EXCEPTION(InvalidDatabaseKind);
92 DEV_SIMPLE_EXCEPTION(DatabaseAlreadyOpen);
93 DEV_SIMPLE_EXCEPTION(DAGCreationFailure);
94 DEV_SIMPLE_EXCEPTION(DAGComputeFailure);
95 
96 DEV_SIMPLE_EXCEPTION(UnsupportedSnapshotManifestVersion);
97 DEV_SIMPLE_EXCEPTION(InvalidSnapshotManifest);
98 DEV_SIMPLE_EXCEPTION(StateTrieReconstructionFailed);
99 DEV_SIMPLE_EXCEPTION(InvalidStateChunkData);
100 DEV_SIMPLE_EXCEPTION(InvalidBlockChunkData);
101 DEV_SIMPLE_EXCEPTION(AccountAlreadyImported);
102 DEV_SIMPLE_EXCEPTION(InvalidWarpStatusPacket);
103 DEV_SIMPLE_EXCEPTION(FailedToDownloadManifest);
104 DEV_SIMPLE_EXCEPTION(FailedToDownloadDaoForkBlockHeader);
105 
106 DEV_SIMPLE_EXCEPTION(AccountLocked);
107 DEV_SIMPLE_EXCEPTION(TransactionRefused);
108 DEV_SIMPLE_EXCEPTION(UnknownAccount);
109 
110 DEV_SIMPLE_EXCEPTION(PeerDisconnected);
111 }
112 }
dev::eth::errinfo_seedHash
boost::error_info< struct tag_seedHash, h256 > errinfo_seedHash
Definition: Exceptions.h:39
dev::eth::errinfo_field
boost::error_info< struct tag_field, int > errinfo_field
Definition: Exceptions.h:34
dev::eth::errinfo_name
boost::error_info< struct tag_field, std::string > errinfo_name
Definition: Exceptions.h:33
Common.h
dev::eth::errinfo_ethashResult
boost::error_info< struct tag_ethashResult, std::tuple< h256, h256 > > errinfo_ethashResult
Definition: Exceptions.h:41
dev::eth::errinfo_target
boost::error_info< struct tag_target, h256 > errinfo_target
Definition: Exceptions.h:38
dev::eth::BadFieldError
boost::tuple< errinfo_field, errinfo_data > BadFieldError
Definition: Exceptions.h:43
Exceptions.h
dev::eth::errinfo_nonce
boost::error_info< struct tag_nonce, h64 > errinfo_nonce
Definition: Exceptions.h:36
dev::eth::errinfo_importResult
boost::error_info< struct tag_importResult, ImportResult > errinfo_importResult
Definition: Exceptions.h:42
dev::eth::DEV_SIMPLE_EXCEPTION
DEV_SIMPLE_EXCEPTION(NoHashRecorded)
dev
Definition: Address.cpp:21
dev::eth::errinfo_mixHash
boost::error_info< struct tag_mixHash, h256 > errinfo_mixHash
Definition: Exceptions.h:40
dev::eth::errinfo_data
boost::error_info< struct tag_data, std::string > errinfo_data
Definition: Exceptions.h:35
dev::eth::errinfo_difficulty
boost::error_info< struct tag_difficulty, u256 > errinfo_difficulty
Definition: Exceptions.h:37