Fabcoin Core  0.16.2
P2P Digital Currency
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 BadFieldError = boost::tuple<errinfo_field, errinfo_data>;
43 
44 DEV_SIMPLE_EXCEPTION(OutOfGasBase);
45 DEV_SIMPLE_EXCEPTION(OutOfGasIntrinsic);
46 DEV_SIMPLE_EXCEPTION(NotEnoughAvailableSpace);
47 DEV_SIMPLE_EXCEPTION(NotEnoughCash);
48 DEV_SIMPLE_EXCEPTION(GasPriceTooLow);
49 DEV_SIMPLE_EXCEPTION(BlockGasLimitReached);
50 DEV_SIMPLE_EXCEPTION(FeeTooSmall);
51 DEV_SIMPLE_EXCEPTION(TooMuchGasUsed);
52 DEV_SIMPLE_EXCEPTION(ExtraDataTooBig);
53 DEV_SIMPLE_EXCEPTION(ExtraDataIncorrect);
54 DEV_SIMPLE_EXCEPTION(InvalidSignature);
55 DEV_SIMPLE_EXCEPTION(InvalidTransactionFormat);
56 DEV_SIMPLE_EXCEPTION(InvalidBlockFormat);
57 DEV_SIMPLE_EXCEPTION(InvalidUnclesHash);
58 DEV_SIMPLE_EXCEPTION(TooManyUncles);
59 DEV_SIMPLE_EXCEPTION(UncleTooOld);
60 DEV_SIMPLE_EXCEPTION(UncleIsBrother);
61 DEV_SIMPLE_EXCEPTION(UncleInChain);
62 DEV_SIMPLE_EXCEPTION(UncleParentNotInChain);
63 DEV_SIMPLE_EXCEPTION(InvalidStateRoot);
64 DEV_SIMPLE_EXCEPTION(InvalidGasUsed);
65 DEV_SIMPLE_EXCEPTION(InvalidTransactionsRoot);
66 DEV_SIMPLE_EXCEPTION(InvalidDifficulty);
67 DEV_SIMPLE_EXCEPTION(InvalidGasLimit);
68 DEV_SIMPLE_EXCEPTION(InvalidReceiptsStateRoot);
69 DEV_SIMPLE_EXCEPTION(InvalidTimestamp);
70 DEV_SIMPLE_EXCEPTION(InvalidLogBloom);
71 DEV_SIMPLE_EXCEPTION(InvalidNonce);
72 DEV_SIMPLE_EXCEPTION(InvalidBlockHeaderItemCount);
73 DEV_SIMPLE_EXCEPTION(InvalidBlockNonce);
74 DEV_SIMPLE_EXCEPTION(InvalidParentHash);
75 DEV_SIMPLE_EXCEPTION(InvalidUncleParentHash);
76 DEV_SIMPLE_EXCEPTION(InvalidNumber);
77 DEV_SIMPLE_EXCEPTION(BlockNotFound);
78 DEV_SIMPLE_EXCEPTION(UnknownParent);
79 
80 DEV_SIMPLE_EXCEPTION(DatabaseAlreadyOpen);
81 DEV_SIMPLE_EXCEPTION(DAGCreationFailure);
82 DEV_SIMPLE_EXCEPTION(DAGComputeFailure);
83 
84 }
85 }
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
boost::error_info< struct tag_field, std::string > errinfo_name
Definition: Exceptions.h:33
boost::error_info< struct tag_field, int > errinfo_field
Definition: Exceptions.h:34
boost::error_info< struct tag_mixHash, h256 > errinfo_mixHash
Definition: Exceptions.h:40
boost::error_info< struct tag_ethashResult, std::tuple< h256, h256 >> errinfo_ethashResult
Definition: Exceptions.h:41
boost::error_info< struct tag_target, h256 > errinfo_target
Definition: Exceptions.h:38
boost::error_info< struct tag_data, std::string > errinfo_data
Definition: Exceptions.h:35
boost::error_info< struct tag_difficulty, u256 > errinfo_difficulty
Definition: Exceptions.h:37
boost::error_info< struct tag_seedHash, h256 > errinfo_seedHash
Definition: Exceptions.h:39
boost::tuple< errinfo_field, errinfo_data > BadFieldError
Definition: Exceptions.h:42
DEV_SIMPLE_EXCEPTION(InvalidSealEngine)
boost::error_info< struct tag_nonce, h64 > errinfo_nonce
Definition: Exceptions.h:36