4#include <boost/core/typeinfo.hpp>
7#define SYS_ASSERT( expr, exc_type, FORMAT, ... ) \
8 FC_MULTILINE_MACRO_BEGIN \
10 FC_THROW_EXCEPTION( exc_type, FORMAT, __VA_ARGS__ ); \
11 FC_MULTILINE_MACRO_END
13#define SYS_THROW( exc_type, FORMAT, ... ) \
14 throw exc_type( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) );
21#define SYS_RETHROW_EXCEPTIONS(exception_type, FORMAT, ... ) \
22 catch( const std::bad_alloc& ) {\
24 } catch( const boost::interprocess::bad_alloc& ) {\
26 } catch (sysio::chain::chain_exception& e) { \
27 FC_RETHROW_EXCEPTION( e, warn, FORMAT, __VA_ARGS__ ); \
28 } catch (fc::exception& e) { \
29 exception_type new_exception(FC_LOG_MESSAGE( warn, FORMAT, __VA_ARGS__ )); \
30 for (const auto& log: e.get_log()) { \
31 new_exception.append_log(log); \
33 throw new_exception; \
34 } catch( const std::exception& e ) { \
35 exception_type fce(FC_LOG_MESSAGE( warn, FORMAT" (${what})" ,__VA_ARGS__("what",e.what()))); \
38 throw fc::unhandled_exception( \
39 FC_LOG_MESSAGE( warn, FORMAT,__VA_ARGS__), \
40 std::current_exception() ); \
48#define SYS_CAPTURE_AND_RETHROW( exception_type, ... ) \
49 catch( const std::bad_alloc& ) {\
51 } catch( const boost::interprocess::bad_alloc& ) {\
53 } catch (sysio::chain::chain_exception& e) { \
54 FC_RETHROW_EXCEPTION( e, warn, "", FC_FORMAT_ARG_PARAMS(__VA_ARGS__) ); \
55 } catch (fc::exception& e) { \
56 exception_type new_exception(e.get_log()); \
57 throw new_exception; \
58 } catch( const std::exception& e ) { \
60 FC_LOG_MESSAGE( warn, "${what}: ",FC_FORMAT_ARG_PARAMS(__VA_ARGS__)("what",e.what())), \
61 fc::std_exception_code,\
62 BOOST_CORE_TYPEID(decltype(e)).name(), \
63 e.what() ) ; throw fce;\
65 throw fc::unhandled_exception( \
66 FC_LOG_MESSAGE( warn, "",FC_FORMAT_ARG_PARAMS(__VA_ARGS__)), \
67 std::current_exception() ); \
73#define CATCH_AND_CALL(NEXT)\
74 catch ( const fc::exception& err ) {\
75 NEXT(err.dynamic_copy_exception());\
76 } catch ( const std::exception& e ) {\
78 FC_LOG_MESSAGE( warn, "rethrow ${what}: ", ("what",e.what())),\
79 fc::std_exception_code,\
80 BOOST_CORE_TYPEID(e).name(),\
82 NEXT(fce.dynamic_copy_exception());\
84 fc::unhandled_exception e(\
85 FC_LOG_MESSAGE(warn, "rethrow"),\
86 std::current_exception());\
87 NEXT(e.dynamic_copy_exception());\
90#define SYS_RECODE_EXC( cause_type, effect_type ) \
91 catch( const cause_type& e ) \
92 { throw( effect_type( e.what(), e.get_log() ) ); }
95#define FC_DECLARE_DERIVED_EXCEPTION_WITH_ERROR_CODE( TYPE, BASE, CODE, WHAT ) \
96 class TYPE : public BASE \
102 explicit TYPE( int64_t code, const std::string& name_value, const std::string& what_value ) \
103 :BASE( code, name_value, what_value ){} \
104 explicit TYPE( fc::log_message&& m, int64_t code, const std::string& name_value, const std::string& what_value ) \
105 :BASE( std::move(m), code, name_value, what_value ){} \
106 explicit TYPE( fc::log_messages&& m, int64_t code, const std::string& name_value, const std::string& what_value )\
107 :BASE( std::move(m), code, name_value, what_value ){}\
108 explicit TYPE( const fc::log_messages& m, int64_t code, const std::string& name_value, const std::string& what_value )\
109 :BASE( m, code, name_value, what_value ){}\
110 TYPE( const std::string& what_value, const fc::log_messages& m ) \
111 :BASE( m, CODE, BOOST_PP_STRINGIZE(TYPE), what_value ){} \
112 TYPE( fc::log_message&& m ) \
113 :BASE( fc::move(m), CODE, BOOST_PP_STRINGIZE(TYPE), WHAT ){}\
114 TYPE( fc::log_messages msgs ) \
115 :BASE( fc::move( msgs ), CODE, BOOST_PP_STRINGIZE(TYPE), WHAT ) {} \
116 TYPE( const TYPE& c ) \
117 :BASE(c),error_code(c.error_code) {} \
118 TYPE( const BASE& c ) \
120 TYPE():BASE(CODE, BOOST_PP_STRINGIZE(TYPE), WHAT){}\
122 virtual std::shared_ptr<fc::exception> dynamic_copy_exception()const\
123 { return std::make_shared<TYPE>( *this ); } \
124 virtual NO_RETURN void dynamic_rethrow_exception()const \
125 { if( code() == CODE ) throw *this;\
126 else fc::exception::dynamic_rethrow_exception(); \
128 std::optional<uint64_t> error_code; \
131namespace sysio {
namespace chain {
140 3000000,
"blockchain exception" )
169 3010001, "Invalid
name" )
171 3010002, "Invalid public key" )
173 3010003, "Invalid private key" )
177 3010005, "Invalid
action" )
181 3010007, "Invalid ABI" )
183 3010008, "Invalid block ID" )
189 3010011, "Invalid
asset" )
191 3010012, "Invalid chain ID" )
193 3010013, "Invalid fixed key" )
195 3010014, "Invalid
symbol" )
197 3010015, "Key type is not
a currently activated type" )
199 3010016, "Signature type is not
a currently activated type" )
206 3020001, "Block can not be found" )
213 3030001, "Unlinkable block" )
215 3030002, "Transaction outputs in block do not match
transaction outputs from applying block" )
217 3030003, "Block does not guarantee concurrent execution without conflicts" )
219 3030004, "Shard locks in block are incorrect or mal-formed" )
221 3030005, "Block exhausted allowed resources" )
223 3030006, "Block is too old to push" )
225 3030007, "Block is from the future" )
227 3030008, "Block is not
signed with expected key" )
229 3030009, "Block is not
signed by expected producer" )
231 3030010, "Invalid block header extension" )
233 3030011, "Block includes an ill-formed protocol feature activation extension" )
235 3030012, "Invalid block extension" )
237 3030013, "Block includes an ill-formed additional block
signature extension" )
248 3040003, "Transaction should have at least
one required
authority" )
252 3040005, "Expired Transaction" )
254 3040006, "Transaction Expiration Too Far" )
256 3040007, "Invalid Reference Block" )
266 3040012, "Pushing too many transactions at once" )
268 3040013, "Transaction is too big" )
274 3040016, "Transaction includes an ill-formed deferred
transaction generation
context extension" )
276 3040017, "Transaction includes disallowed
extensions (invalid block)" )
278 3040018, "Transaction exceeded transient resource limit" )
285 3050001, "Account
name already exists" )
287 3050002, "Invalid Action Arguments" )
289 3050003, "sysio_assert_message assertion failure" )
291 3050004, "sysio_assert_code assertion failure" )
293 3050005, "Action can not be found" )
295 3050006, "Mismatch between
action data and its struct" )
297 3050007, "Attempt to use unaccessible API" )
299 3050008, "Abort Called" )
301 3050009, "Inline Action exceeds maximum size limit" )
303 3050010, "Action attempts to increase RAM usage of account without authorization" )
305 3050011, "sysio_assert_code assertion failure uses restricted error code
value" )
307 3050012, "Inline
action exceeds maximum size limit for
a non-privileged account" )
315 3060001, "Permission Query Exception" )
317 3060002, "Account Query Exception" )
319 3060003, "Contract Table Query Exception" )
321 3060004, "Contract Query Exception" )
323 3060005, "Database is an
unknown or unsupported version" )
326 3060100, "Guard Exception" )
329 3060101, "Database usage is at unsafe levels" )
332 3070000, "
WASM Exception" )
340 3070004, "
memcpy with overlapping memory" )
346 3080000, "Resource exhausted
exception" )
349 3080001, "Account using more than allotted RAM usage" )
351 3080002, "Transaction exceeded the current network usage limit imposed on the
transaction" )
353 3080003, "Transaction network usage is too much for the remaining allowable usage of the current block" )
355 3080004, "Transaction exceeded the current CPU usage limit imposed on the
transaction" )
357 3080005, "Transaction CPU usage is too much for the remaining allowable usage of the current block" )
359 3080006, "Transaction took too
long" )
361 3080007, "Transaction exceeded the current greylisted account network usage limit" )
363 3080008, "Transaction exceeded the current greylisted account CPU usage limit" )
366 3081001, "Transaction reached the deadline set due to leeway on account CPU limits" )
371 3090001, "Duplicate
signature included" )
373 3090002, "Irrelevant
signature included" )
375 3090003, "Provided keys, permissions, and delays do not satisfy declared authorizations" )
379 3090005, "Irrelevant
authority included" )
381 3090006, "Insufficient delay" )
383 3090007, "Invalid Permission" )
385 3090008, "The
action is not allowed to be linked with minimum permission" )
387 3090009, "The parent permission is invalid" )
393 3100001, "Internal
state is no longer consistent" )
395 3100002, "Unknown block" )
399 3100004, "Corrupted reversible block
database was fixed" )
401 3100005, "Extracted genesis
state from blocks.log" )
403 3100006, "Subjective
exception thrown during block production" )
405 3100007, "Multiple voter info detected" )
407 3100008, "Feature is currently unsupported" )
409 3100009, "
Node management operation successfully executed" )
413 3100011, "Variable length component of
signature too large" )
420 3110001, "Missing Chain API Plugin" )
422 3110002, "Missing Wallet API Plugin" )
424 3110003, "Missing History API Plugin" )
426 3110004, "Missing Net API Plugin" )
428 3110005, "Missing Chain Plugin" )
430 3110006, "Incorrect
plugin configuration" )
432 3110007, "Missing Trace API Plugin" )
439 3120001, "Wallet already exists" )
441 3120002, "Nonexistent wallet" )
443 3120003, "Locked wallet" )
445 3120004, "Missing public key" )
447 3120005, "Invalid wallet password" )
449 3120006, "No available wallet" )
451 3120007, "Already unlocked" )
453 3120008, "Key already exists" )
455 3120009, "Nonexistent key" )
457 3120010, "Unsupported key type" )
459 3120011, "Wallet lock timeout is invalid" )
461 3120012, "Secure Enclave Exception" )
465 3130000, "Actor or contract whitelist/blacklist
exception" )
472 3130003, "Contract to execute is not on the whitelist" )
474 3130004, "Contract to execute is on the blacklist" )
476 3130005, "Action to execute is on the blacklist" )
478 3130006, "Public key in
authority is on the blacklist" )
481 3140000, "Exceptions that are allowed to bubble out of emit calls in
controller" )
483 3140001, "Block does not match checkpoint" )
485 3140002, "State history write error" )
491 3015001, "No ABI found" )
493 3015002, "Invalid Ricardian Clause" )
495 3015003, "Invalid Ricardian Action" )
497 3015004, "The type defined in the ABI is invalid" )
499 3015005, "Duplicate type definition in the ABI" )
501 3015006, "Duplicate struct definition in the ABI" )
503 3015007, "Duplicate
action definition in the ABI" )
505 3015008, "Duplicate table definition in the ABI" )
507 3015009, "Duplicate error message definition in the ABI" )
509 3015010, "ABI serialization time has exceeded the deadline" )
511 3015011, "ABI recursive definition has exceeded the max recursion depth" )
513 3015012, "Circular definition is detected in the ABI" )
519 3015015, "Duplicate
variant definition in the ABI" )
521 3015016, "ABI has an unsupported version" )
528 3160001, "The payer of the table data is invalid" )
530 3160002, "Table access violation" )
532 3160003, "Invalid table iterator" )
534 3160004, "Table can not be found inside the cache" )
536 3160005, "The table operation is not allowed" )
538 3160006, "Invalid contract vm type" )
540 3160007, "Invalid contract vm version" )
542 3160008, "Contract is already running this version of code" )
544 3160009, "No wasm file found" )
546 3160010, "No abi file found" )
550 3160016, "Parsing
config error" )
555 3170001, "Producer private key is not available" )
557 3170002, "Pending block
state is missing" )
559 3170003, "Producer is
double confirming known range" )
563 3170006, "The producer is not part of current schedule" )
565 3170007, "The configured snapshot directory does not exist" )
567 3170008, "The requested snapshot already exists" )
569 3170009, "Snapshot Finalization Exception" )
571 3170010, "The protocol features to be activated were not valid" )
573 3170011, "The signer returned no valid block signatures" )
575 3170012, "The signer returned multiple signatures but that is not supported" )
580 3180001, "Invalid reversible blocks directory" )
582 3180002, "Backup directory for reversible blocks already existg" )
584 3180003, "Gap in the reversible blocks
database" )
589 3190001, "unsupported version of block log" )
591 3190002, "fail to append block to the block log" )
593 3190003, "block log can not be found" )
595 3190004, "block log backup dir already exists" )
597 3190005, "block index can not be found" )
602 3200001, "invalid http
client root certificate" )
604 3200002, "invalid http response" )
606 3200003, "service resolved to multiple ports" )
608 3200004, "fail to resolve host" )
610 3200005, "http request fail" )
612 3200006, "invalid http request" )
620 3230001, "Crypto API Exception" )
622 3230002, "Database API Exception" )
624 3230003, "Arithmetic Exception" )
629 3240001, "Snapshot Validation Exception" )
634 3250001, "Protocol feature validation
exception" )
636 3250002, "Protocol feature
exception (invalid block)" )
638 3250003, "Protocol feature iterator
exception" )
#define FC_DECLARE_DERIVED_EXCEPTION_WITH_ERROR_CODE(TYPE, BASE, CODE, WHAT)
Used to generate a useful error report when an exception is thrown.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Defines exception's used by fc.
#define FC_DECLARE_DERIVED_EXCEPTION(TYPE, BASE, CODE, WHAT)
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found Unlinkable block Block does not guarantee concurrent execution without conflicts Block exhausted allowed resources Block is from the future Block is not signed by expected producer Block includes an ill formed protocol feature activation extension Block includes an ill formed additional block signature extension Error decompressing transaction Transaction should have at least one required authority Expired Transaction Invalid Reference Block Duplicate deferred transaction The transaction can not be found Transaction is too big Invalid transaction extension Transaction includes disallowed extensions(invalid block)" ) FC_DECLARE_DERIVED_EXCEPTION( tx_resource_exhaustion
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found Unlinkable block Block does not guarantee concurrent execution without conflicts Block exhausted allowed resources Block is from the future Block is not signed by expected producer Block includes an ill formed protocol feature activation extension Block includes an ill formed additional block signature extension Error decompressing transaction Transaction should have at least one required authority Expired Transaction Invalid Reference Block Duplicate deferred transaction The transaction can not be found Transaction is too big Invalid transaction extension Transaction includes disallowed Transaction exceeded transient resource limit Account name already exists sysio_assert_message assertion failure Action can not be found Attempt to use unaccessible API Inline Action exceeds maximum size limit sysio_assert_code assertion failure uses restricted error code value action return value size too big Permission Query Exception Contract Table Query Exception Database is an unknown or unsupported version Database usage is at unsafe levels wasm_exception
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found Unlinkable block Block does not guarantee concurrent execution without conflicts Block exhausted allowed resources Block is from the future Block is not signed by expected producer Block includes an ill formed protocol feature activation extension Block includes an ill formed additional block signature extension transaction_exception
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found Unlinkable block Block does not guarantee concurrent execution without conflicts Block exhausted allowed resources Block is from the future Block is not signed by expected producer Block includes an ill formed protocol feature activation extension Block includes an ill formed additional block signature extension Error decompressing transaction Transaction should have at least one required authority Expired Transaction Invalid Reference Block Duplicate deferred transaction The transaction can not be found Transaction is too big Invalid transaction extension Transaction includes disallowed Transaction exceeded transient resource limit Account name already exists sysio_assert_message assertion failure Action can not be found Attempt to use unaccessible API Inline Action exceeds maximum size limit sysio_assert_code assertion failure uses restricted error code value action return value size too big Permission Query Exception Contract Table Query Exception Database is an unknown or unsupported version guard_exception
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found Unlinkable block Block does not guarantee concurrent execution without conflicts Block exhausted allowed resources Block is from the future Block is not signed by expected producer Block includes an ill formed protocol feature activation extension Block includes an ill formed additional block signature extension Error decompressing transaction Transaction should have at least one required authority Expired Transaction Invalid Reference Block Duplicate deferred transaction The transaction can not be found Transaction is too big Invalid transaction extension Transaction includes disallowed Transaction exceeded transient resource limit Account name already exists sysio_assert_message assertion failure Action can not be found Attempt to use unaccessible API Inline Action exceeds maximum size limit sysio_assert_code assertion failure uses restricted error code value action return value size too big database_exception
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found Unlinkable block Block does not guarantee concurrent execution without conflicts Block exhausted allowed resources Block is from the future Block is not signed by expected producer Block includes an ill formed protocol feature activation extension Block includes an ill formed additional block signature extension Error decompressing transaction Transaction should have at least one required authority Expired Transaction Invalid Reference Block Duplicate deferred transaction The transaction can not be found Transaction is too big Invalid transaction extension Transaction includes disallowed Transaction exceeded transient resource limit action_validate_exception
chain type exception chain_type_exception
@ contract_restricted_error_code
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found block_validate_exception
bool validate(const Authority &auth)
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type fork_database_exception
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
unsigned __int64 uint64_t
Immutable except for fc::from_variant.
account_query_db::get_accounts_by_authorizers_result results
memcpy((char *) pInfo->slotDescription, s, l)