Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <boost/core/typeinfo.hpp>
5
6
7#define SYS_ASSERT( expr, exc_type, FORMAT, ... ) \
8 FC_MULTILINE_MACRO_BEGIN \
9 if( !(expr) ) \
10 FC_THROW_EXCEPTION( exc_type, FORMAT, __VA_ARGS__ ); \
11 FC_MULTILINE_MACRO_END
12
13#define SYS_THROW( exc_type, FORMAT, ... ) \
14 throw exc_type( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) );
15
21#define SYS_RETHROW_EXCEPTIONS(exception_type, FORMAT, ... ) \
22 catch( const std::bad_alloc& ) {\
23 throw;\
24 } catch( const boost::interprocess::bad_alloc& ) {\
25 throw;\
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); \
32 } \
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()))); \
36 throw fce;\
37 } catch( ... ) { \
38 throw fc::unhandled_exception( \
39 FC_LOG_MESSAGE( warn, FORMAT,__VA_ARGS__), \
40 std::current_exception() ); \
41 }
42
48#define SYS_CAPTURE_AND_RETHROW( exception_type, ... ) \
49 catch( const std::bad_alloc& ) {\
50 throw;\
51 } catch( const boost::interprocess::bad_alloc& ) {\
52 throw;\
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 ) { \
59 exception_type fce( \
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;\
64 } catch( ... ) { \
65 throw fc::unhandled_exception( \
66 FC_LOG_MESSAGE( warn, "",FC_FORMAT_ARG_PARAMS(__VA_ARGS__)), \
67 std::current_exception() ); \
68 }
69
73#define CATCH_AND_CALL(NEXT)\
74 catch ( const fc::exception& err ) {\
75 NEXT(err.dynamic_copy_exception());\
76 } catch ( const std::exception& e ) {\
77 fc::exception fce( \
78 FC_LOG_MESSAGE( warn, "rethrow ${what}: ", ("what",e.what())),\
79 fc::std_exception_code,\
80 BOOST_CORE_TYPEID(e).name(),\
81 e.what() ) ;\
82 NEXT(fce.dynamic_copy_exception());\
83 } catch( ... ) {\
84 fc::unhandled_exception e(\
85 FC_LOG_MESSAGE(warn, "rethrow"),\
86 std::current_exception());\
87 NEXT(e.dynamic_copy_exception());\
88 }
89
90#define SYS_RECODE_EXC( cause_type, effect_type ) \
91 catch( const cause_type& e ) \
92 { throw( effect_type( e.what(), e.get_log() ) ); }
93
94
95#define FC_DECLARE_DERIVED_EXCEPTION_WITH_ERROR_CODE( TYPE, BASE, CODE, WHAT ) \
96 class TYPE : public BASE \
97 { \
98 public: \
99 enum code_enum { \
100 code_value = CODE, \
101 }; \
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 ) \
119 :BASE(c){} \
120 TYPE():BASE(CODE, BOOST_PP_STRINGIZE(TYPE), WHAT){}\
121 \
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(); \
127 } \
128 std::optional<uint64_t> error_code; \
129 };
130
131namespace sysio { namespace chain {
132
134 generic_system_error = 10000000000000000000ULL,
135 contract_restricted_error_code, //< contract used an error code reserved for system usage
136 };
137
138
140 3000000, "blockchain exception" )
166 3010000, "chain type exception" )
167
169 3010001, "Invalid name" )
171 3010002, "Invalid public key" )
173 3010003, "Invalid private key" )
174 FC_DECLARE_DERIVED_EXCEPTION( authority_type_exception, chain_type_exception,
175 3010004, "Invalid authority" )
177 3010005, "Invalid action" )
178 FC_DECLARE_DERIVED_EXCEPTION( transaction_type_exception, chain_type_exception,
179 3010006, "Invalid transaction" )
181 3010007, "Invalid ABI" )
182 FC_DECLARE_DERIVED_EXCEPTION( block_id_type_exception, chain_type_exception,
183 3010008, "Invalid block ID" )
184 FC_DECLARE_DERIVED_EXCEPTION( transaction_id_type_exception, chain_type_exception,
185 3010009, "Invalid transaction ID" )
186 FC_DECLARE_DERIVED_EXCEPTION( packed_transaction_type_exception, chain_type_exception,
187 3010010, "Invalid packed transaction" )
189 3010011, "Invalid asset" )
190 FC_DECLARE_DERIVED_EXCEPTION( chain_id_type_exception, chain_type_exception,
191 3010012, "Invalid chain ID" )
193 3010013, "Invalid fixed key" )
195 3010014, "Invalid symbol" )
197 3010015, "Key type is not a currently activated type" )
198 FC_DECLARE_DERIVED_EXCEPTION( unactivated_signature_type, chain_type_exception,
199 3010016, "Signature type is not a currently activated type" )
200
201
203 3020000, "Fork database exception" )
204
206 3020001, "Block can not be found" )
207
208
210 3030000, "Block exception" )
211
213 3030001, "Unlinkable block" )
215 3030002, "Transaction outputs in block do not match transaction outputs from applying block" )
216 FC_DECLARE_DERIVED_EXCEPTION( block_concurrency_exception, block_validate_exception,
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" )
232 FC_DECLARE_DERIVED_EXCEPTION( ill_formed_protocol_feature_activation, block_validate_exception,
233 3030011, "Block includes an ill-formed protocol feature activation extension" )
235 3030012, "Invalid block extension" )
236 FC_DECLARE_DERIVED_EXCEPTION( ill_formed_additional_block_signatures_extension, block_validate_exception,
237 3030013, "Block includes an ill-formed additional block signature extension" )
238
239
241 3040000, "Transaction exception" )
242
244 3040001, "Error decompressing transaction" )
246 3040002, "Transaction should have at least one normal action" )
248 3040003, "Transaction should have at least one required authority" )
250 3040004, "Context-free action should have no required authority" )
252 3040005, "Expired Transaction" )
254 3040006, "Transaction Expiration Too Far" )
255 FC_DECLARE_DERIVED_EXCEPTION( invalid_ref_block_exception, transaction_exception,
256 3040007, "Invalid Reference Block" )
258 3040008, "Duplicate transaction" )
260 3040009, "Duplicate deferred transaction" )
262 3040010, "Context free action is not allowed inside generated transaction" )
264 3040011, "The transaction can not be found" )
266 3040012, "Pushing too many transactions at once" )
268 3040013, "Transaction is too big" )
269 FC_DECLARE_DERIVED_EXCEPTION( unknown_transaction_compression, transaction_exception,
270 3040014, "Unknown transaction compression" )
271 FC_DECLARE_DERIVED_EXCEPTION( invalid_transaction_extension, transaction_exception,
272 3040015, "Invalid transaction extension" )
273 FC_DECLARE_DERIVED_EXCEPTION( ill_formed_deferred_transaction_generation_context, transaction_exception,
274 3040016, "Transaction includes an ill-formed deferred transaction generation context extension" )
275 FC_DECLARE_DERIVED_EXCEPTION( disallowed_transaction_extensions_bad_block_exception, transaction_exception,
276 3040017, "Transaction includes disallowed extensions (invalid block)" )
278 3040018, "Transaction exceeded transient resource limit" )
279
280
282 3050000, "Action validate exception" )
283
285 3050001, "Account name already exists" )
287 3050002, "Invalid Action Arguments" )
288 FC_DECLARE_DERIVED_EXCEPTION( sysio_assert_message_exception, action_validate_exception,
289 3050003, "sysio_assert_message assertion failure" )
291 3050004, "sysio_assert_code assertion failure" )
292 FC_DECLARE_DERIVED_EXCEPTION( action_not_found_exception, action_validate_exception,
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" )
304 FC_DECLARE_DERIVED_EXCEPTION( restricted_error_code_exception, action_validate_exception,
305 3050011, "sysio_assert_code assertion failure uses restricted error code value" )
306 FC_DECLARE_DERIVED_EXCEPTION( inline_action_too_big_nonprivileged, action_validate_exception,
307 3050012, "Inline action exceeds maximum size limit for a non-privileged account" )
308 FC_DECLARE_DERIVED_EXCEPTION( action_return_value_exception, action_validate_exception,
309 3050014, "action return value size too big" )
310
312 3060000, "Database exception" )
313
315 3060001, "Permission Query Exception" )
317 3060002, "Account Query Exception" )
318 FC_DECLARE_DERIVED_EXCEPTION( contract_table_query_exception, database_exception,
319 3060003, "Contract Table Query Exception" )
321 3060004, "Contract Query Exception" )
322 FC_DECLARE_DERIVED_EXCEPTION( bad_database_version_exception, database_exception,
323 3060005, "Database is an unknown or unsupported version" )
324
326 3060100, "Guard Exception" )
327
329 3060101, "Database usage is at unsafe levels" )
330
332 3070000, "WASM Exception" )
334 3070001, "Error in WASM page memory" )
336 3070002, "Runtime Error Processing WASM" )
337 FC_DECLARE_DERIVED_EXCEPTION( wasm_serialization_error, wasm_exception,
338 3070003, "Serialization Error Processing WASM" )
340 3070004, "memcpy with overlapping memory" )
341 FC_DECLARE_DERIVED_EXCEPTION( binaryen_exception, wasm_exception,
342 3070005, "binaryen exception" )
343
344
345 FC_DECLARE_DERIVED_EXCEPTION( resource_exhausted_exception, chain_exception,
346 3080000, "Resource exhausted exception" )
347
348 FC_DECLARE_DERIVED_EXCEPTION( ram_usage_exceeded, resource_exhausted_exception,
349 3080001, "Account using more than allotted RAM usage" )
350 FC_DECLARE_DERIVED_EXCEPTION( tx_net_usage_exceeded, resource_exhausted_exception,
351 3080002, "Transaction exceeded the current network usage limit imposed on the transaction" )
352 FC_DECLARE_DERIVED_EXCEPTION( block_net_usage_exceeded, resource_exhausted_exception,
353 3080003, "Transaction network usage is too much for the remaining allowable usage of the current block" )
354 FC_DECLARE_DERIVED_EXCEPTION( tx_cpu_usage_exceeded, resource_exhausted_exception,
355 3080004, "Transaction exceeded the current CPU usage limit imposed on the transaction" )
356 FC_DECLARE_DERIVED_EXCEPTION( block_cpu_usage_exceeded, resource_exhausted_exception,
357 3080005, "Transaction CPU usage is too much for the remaining allowable usage of the current block" )
358 FC_DECLARE_DERIVED_EXCEPTION( deadline_exception, resource_exhausted_exception,
359 3080006, "Transaction took too long" )
360 FC_DECLARE_DERIVED_EXCEPTION( greylist_net_usage_exceeded, resource_exhausted_exception,
361 3080007, "Transaction exceeded the current greylisted account network usage limit" )
362 FC_DECLARE_DERIVED_EXCEPTION( greylist_cpu_usage_exceeded, resource_exhausted_exception,
363 3080008, "Transaction exceeded the current greylisted account CPU usage limit" )
364
365 FC_DECLARE_DERIVED_EXCEPTION( leeway_deadline_exception, deadline_exception,
366 3081001, "Transaction reached the deadline set due to leeway on account CPU limits" )
367
368 FC_DECLARE_DERIVED_EXCEPTION( authorization_exception, chain_exception,
369 3090000, "Authorization exception" )
370 FC_DECLARE_DERIVED_EXCEPTION( tx_duplicate_sig, authorization_exception,
371 3090001, "Duplicate signature included" )
372 FC_DECLARE_DERIVED_EXCEPTION( tx_irrelevant_sig, authorization_exception,
373 3090002, "Irrelevant signature included" )
374 FC_DECLARE_DERIVED_EXCEPTION( unsatisfied_authorization, authorization_exception,
375 3090003, "Provided keys, permissions, and delays do not satisfy declared authorizations" )
376 FC_DECLARE_DERIVED_EXCEPTION( missing_auth_exception, authorization_exception,
377 3090004, "Missing required authority" )
378 FC_DECLARE_DERIVED_EXCEPTION( irrelevant_auth_exception, authorization_exception,
379 3090005, "Irrelevant authority included" )
380 FC_DECLARE_DERIVED_EXCEPTION( insufficient_delay_exception, authorization_exception,
381 3090006, "Insufficient delay" )
382 FC_DECLARE_DERIVED_EXCEPTION( invalid_permission, authorization_exception,
383 3090007, "Invalid Permission" )
384 FC_DECLARE_DERIVED_EXCEPTION( unlinkable_min_permission_action, authorization_exception,
385 3090008, "The action is not allowed to be linked with minimum permission" )
386 FC_DECLARE_DERIVED_EXCEPTION( invalid_parent_permission, authorization_exception,
387 3090009, "The parent permission is invalid" )
388
389 FC_DECLARE_DERIVED_EXCEPTION( misc_exception, chain_exception,
390 3100000, "Miscellaneous exception" )
391
392 FC_DECLARE_DERIVED_EXCEPTION( rate_limiting_state_inconsistent, misc_exception,
393 3100001, "Internal state is no longer consistent" )
394 FC_DECLARE_DERIVED_EXCEPTION( unknown_block_exception, misc_exception,
395 3100002, "Unknown block" )
396 FC_DECLARE_DERIVED_EXCEPTION( unknown_transaction_exception, misc_exception,
397 3100003, "Unknown transaction" )
398 FC_DECLARE_DERIVED_EXCEPTION( fixed_reversible_db_exception, misc_exception,
399 3100004, "Corrupted reversible block database was fixed" )
400 FC_DECLARE_DERIVED_EXCEPTION( extract_genesis_state_exception, misc_exception,
401 3100005, "Extracted genesis state from blocks.log" )
402 FC_DECLARE_DERIVED_EXCEPTION( subjective_block_production_exception, misc_exception,
403 3100006, "Subjective exception thrown during block production" )
404 FC_DECLARE_DERIVED_EXCEPTION( multiple_voter_info, misc_exception,
405 3100007, "Multiple voter info detected" )
406 FC_DECLARE_DERIVED_EXCEPTION( unsupported_feature, misc_exception,
407 3100008, "Feature is currently unsupported" )
408 FC_DECLARE_DERIVED_EXCEPTION( node_management_success, misc_exception,
409 3100009, "Node management operation successfully executed" )
410 FC_DECLARE_DERIVED_EXCEPTION( json_parse_exception, misc_exception,
411 3100010, "JSON parse exception" )
412 FC_DECLARE_DERIVED_EXCEPTION( sig_variable_size_limit_exception, misc_exception,
413 3100011, "Variable length component of signature too large" )
414
415
416 FC_DECLARE_DERIVED_EXCEPTION( plugin_exception, chain_exception,
417 3110000, "Plugin exception" )
418
419 FC_DECLARE_DERIVED_EXCEPTION( missing_chain_api_plugin_exception, plugin_exception,
420 3110001, "Missing Chain API Plugin" )
421 FC_DECLARE_DERIVED_EXCEPTION( missing_wallet_api_plugin_exception, plugin_exception,
422 3110002, "Missing Wallet API Plugin" )
423 FC_DECLARE_DERIVED_EXCEPTION( missing_history_api_plugin_exception, plugin_exception,
424 3110003, "Missing History API Plugin" )
425 FC_DECLARE_DERIVED_EXCEPTION( missing_net_api_plugin_exception, plugin_exception,
426 3110004, "Missing Net API Plugin" )
427 FC_DECLARE_DERIVED_EXCEPTION( missing_chain_plugin_exception, plugin_exception,
428 3110005, "Missing Chain Plugin" )
429 FC_DECLARE_DERIVED_EXCEPTION( plugin_config_exception, plugin_exception,
430 3110006, "Incorrect plugin configuration" )
431 FC_DECLARE_DERIVED_EXCEPTION( missing_trace_api_plugin_exception, plugin_exception,
432 3110007, "Missing Trace API Plugin" )
433
434
435 FC_DECLARE_DERIVED_EXCEPTION( wallet_exception, chain_exception,
436 3120000, "Wallet exception" )
437
438 FC_DECLARE_DERIVED_EXCEPTION( wallet_exist_exception, wallet_exception,
439 3120001, "Wallet already exists" )
440 FC_DECLARE_DERIVED_EXCEPTION( wallet_nonexistent_exception, wallet_exception,
441 3120002, "Nonexistent wallet" )
442 FC_DECLARE_DERIVED_EXCEPTION( wallet_locked_exception, wallet_exception,
443 3120003, "Locked wallet" )
444 FC_DECLARE_DERIVED_EXCEPTION( wallet_missing_pub_key_exception, wallet_exception,
445 3120004, "Missing public key" )
446 FC_DECLARE_DERIVED_EXCEPTION( wallet_invalid_password_exception, wallet_exception,
447 3120005, "Invalid wallet password" )
448 FC_DECLARE_DERIVED_EXCEPTION( wallet_not_available_exception, wallet_exception,
449 3120006, "No available wallet" )
450 FC_DECLARE_DERIVED_EXCEPTION( wallet_unlocked_exception, wallet_exception,
451 3120007, "Already unlocked" )
452 FC_DECLARE_DERIVED_EXCEPTION( key_exist_exception, wallet_exception,
453 3120008, "Key already exists" )
454 FC_DECLARE_DERIVED_EXCEPTION( key_nonexistent_exception, wallet_exception,
455 3120009, "Nonexistent key" )
456 FC_DECLARE_DERIVED_EXCEPTION( unsupported_key_type_exception, wallet_exception,
457 3120010, "Unsupported key type" )
458 FC_DECLARE_DERIVED_EXCEPTION( invalid_lock_timeout_exception, wallet_exception,
459 3120011, "Wallet lock timeout is invalid" )
460 FC_DECLARE_DERIVED_EXCEPTION( secure_enclave_exception, wallet_exception,
461 3120012, "Secure Enclave Exception" )
462
463
464 FC_DECLARE_DERIVED_EXCEPTION( whitelist_blacklist_exception, chain_exception,
465 3130000, "Actor or contract whitelist/blacklist exception" )
466
467 FC_DECLARE_DERIVED_EXCEPTION( actor_whitelist_exception, whitelist_blacklist_exception,
468 3130001, "Authorizing actor of transaction is not on the whitelist" )
469 FC_DECLARE_DERIVED_EXCEPTION( actor_blacklist_exception, whitelist_blacklist_exception,
470 3130002, "Authorizing actor of transaction is on the blacklist" )
471 FC_DECLARE_DERIVED_EXCEPTION( contract_whitelist_exception, whitelist_blacklist_exception,
472 3130003, "Contract to execute is not on the whitelist" )
473 FC_DECLARE_DERIVED_EXCEPTION( contract_blacklist_exception, whitelist_blacklist_exception,
474 3130004, "Contract to execute is on the blacklist" )
475 FC_DECLARE_DERIVED_EXCEPTION( action_blacklist_exception, whitelist_blacklist_exception,
476 3130005, "Action to execute is on the blacklist" )
477 FC_DECLARE_DERIVED_EXCEPTION( key_blacklist_exception, whitelist_blacklist_exception,
478 3130006, "Public key in authority is on the blacklist" )
479
480 FC_DECLARE_DERIVED_EXCEPTION( controller_emit_signal_exception, chain_exception,
481 3140000, "Exceptions that are allowed to bubble out of emit calls in controller" )
482 FC_DECLARE_DERIVED_EXCEPTION( checkpoint_exception, controller_emit_signal_exception,
483 3140001, "Block does not match checkpoint" )
484 FC_DECLARE_DERIVED_EXCEPTION( state_history_write_exception, controller_emit_signal_exception,
485 3140002, "State history write error" )
486
487
488 FC_DECLARE_DERIVED_EXCEPTION( abi_exception, chain_exception,
489 3015000, "ABI exception" )
490 FC_DECLARE_DERIVED_EXCEPTION( abi_not_found_exception, abi_exception,
491 3015001, "No ABI found" )
492 FC_DECLARE_DERIVED_EXCEPTION( invalid_ricardian_clause_exception, abi_exception,
493 3015002, "Invalid Ricardian Clause" )
494 FC_DECLARE_DERIVED_EXCEPTION( invalid_ricardian_action_exception, abi_exception,
495 3015003, "Invalid Ricardian Action" )
496 FC_DECLARE_DERIVED_EXCEPTION( invalid_type_inside_abi, abi_exception,
497 3015004, "The type defined in the ABI is invalid" ) // Not to be confused with abi_type_exception
498 FC_DECLARE_DERIVED_EXCEPTION( duplicate_abi_type_def_exception, abi_exception,
499 3015005, "Duplicate type definition in the ABI" )
500 FC_DECLARE_DERIVED_EXCEPTION( duplicate_abi_struct_def_exception, abi_exception,
501 3015006, "Duplicate struct definition in the ABI" )
502 FC_DECLARE_DERIVED_EXCEPTION( duplicate_abi_action_def_exception, abi_exception,
503 3015007, "Duplicate action definition in the ABI" )
504 FC_DECLARE_DERIVED_EXCEPTION( duplicate_abi_table_def_exception, abi_exception,
505 3015008, "Duplicate table definition in the ABI" )
506 FC_DECLARE_DERIVED_EXCEPTION( duplicate_abi_err_msg_def_exception, abi_exception,
507 3015009, "Duplicate error message definition in the ABI" )
508 FC_DECLARE_DERIVED_EXCEPTION( abi_serialization_deadline_exception, abi_exception,
509 3015010, "ABI serialization time has exceeded the deadline" )
510 FC_DECLARE_DERIVED_EXCEPTION( abi_recursion_depth_exception, abi_exception,
511 3015011, "ABI recursive definition has exceeded the max recursion depth" )
512 FC_DECLARE_DERIVED_EXCEPTION( abi_circular_def_exception, abi_exception,
513 3015012, "Circular definition is detected in the ABI" )
514 FC_DECLARE_DERIVED_EXCEPTION( unpack_exception, abi_exception,
515 3015013, "Unpack data exception" )
516 FC_DECLARE_DERIVED_EXCEPTION( pack_exception, abi_exception,
517 3015014, "Pack data exception" )
518 FC_DECLARE_DERIVED_EXCEPTION( duplicate_abi_variant_def_exception, abi_exception,
519 3015015, "Duplicate variant definition in the ABI" )
520 FC_DECLARE_DERIVED_EXCEPTION( unsupported_abi_version_exception, abi_exception,
521 3015016, "ABI has an unsupported version" )
522 FC_DECLARE_DERIVED_EXCEPTION( duplicate_abi_action_results_def_exception, abi_exception,
523 3015017, "Duplicate action results definition in the ABI" )
524
525 FC_DECLARE_DERIVED_EXCEPTION( contract_exception, chain_exception,
526 3160000, "Contract exception" )
527 FC_DECLARE_DERIVED_EXCEPTION( invalid_table_payer, contract_exception,
528 3160001, "The payer of the table data is invalid" )
529 FC_DECLARE_DERIVED_EXCEPTION( table_access_violation, contract_exception,
530 3160002, "Table access violation" )
531 FC_DECLARE_DERIVED_EXCEPTION( invalid_table_iterator, contract_exception,
532 3160003, "Invalid table iterator" )
533 FC_DECLARE_DERIVED_EXCEPTION( table_not_in_cache, contract_exception,
534 3160004, "Table can not be found inside the cache" )
535 FC_DECLARE_DERIVED_EXCEPTION( table_operation_not_permitted, contract_exception,
536 3160005, "The table operation is not allowed" )
537 FC_DECLARE_DERIVED_EXCEPTION( invalid_contract_vm_type, contract_exception,
538 3160006, "Invalid contract vm type" )
539 FC_DECLARE_DERIVED_EXCEPTION( invalid_contract_vm_version, contract_exception,
540 3160007, "Invalid contract vm version" )
541 FC_DECLARE_DERIVED_EXCEPTION( set_exact_code, contract_exception,
542 3160008, "Contract is already running this version of code" )
543 FC_DECLARE_DERIVED_EXCEPTION( wasm_file_not_found, contract_exception,
544 3160009, "No wasm file found" )
545 FC_DECLARE_DERIVED_EXCEPTION( abi_file_not_found, contract_exception,
546 3160010, "No abi file found" )
547 FC_DECLARE_DERIVED_EXCEPTION( wasm_config_unknown_version, contract_exception,
548 3160015, "Unknown wasm_config version" )
549 FC_DECLARE_DERIVED_EXCEPTION( config_parse_error, contract_exception,
550 3160016, "Parsing config error" )
551
552 FC_DECLARE_DERIVED_EXCEPTION( producer_exception, chain_exception,
553 3170000, "Producer exception" )
554 FC_DECLARE_DERIVED_EXCEPTION( producer_priv_key_not_found, producer_exception,
555 3170001, "Producer private key is not available" )
556 FC_DECLARE_DERIVED_EXCEPTION( missing_pending_block_state, producer_exception,
557 3170002, "Pending block state is missing" )
558 FC_DECLARE_DERIVED_EXCEPTION( producer_double_confirm, producer_exception,
559 3170003, "Producer is double confirming known range" )
560 FC_DECLARE_DERIVED_EXCEPTION( producer_schedule_exception, producer_exception,
561 3170004, "Producer schedule exception" )
562 FC_DECLARE_DERIVED_EXCEPTION( producer_not_in_schedule, producer_exception,
563 3170006, "The producer is not part of current schedule" )
564 FC_DECLARE_DERIVED_EXCEPTION( snapshot_directory_not_found_exception, producer_exception,
565 3170007, "The configured snapshot directory does not exist" )
566 FC_DECLARE_DERIVED_EXCEPTION( snapshot_exists_exception, producer_exception,
567 3170008, "The requested snapshot already exists" )
568 FC_DECLARE_DERIVED_EXCEPTION( snapshot_finalization_exception, producer_exception,
569 3170009, "Snapshot Finalization Exception" )
570 FC_DECLARE_DERIVED_EXCEPTION( invalid_protocol_features_to_activate, producer_exception,
571 3170010, "The protocol features to be activated were not valid" )
572 FC_DECLARE_DERIVED_EXCEPTION( no_block_signatures, producer_exception,
573 3170011, "The signer returned no valid block signatures" )
574 FC_DECLARE_DERIVED_EXCEPTION( unsupported_multiple_block_signatures, producer_exception,
575 3170012, "The signer returned multiple signatures but that is not supported" )
576
577 FC_DECLARE_DERIVED_EXCEPTION( reversible_blocks_exception, chain_exception,
578 3180000, "Reversible Blocks exception" )
579 FC_DECLARE_DERIVED_EXCEPTION( invalid_reversible_blocks_dir, reversible_blocks_exception,
580 3180001, "Invalid reversible blocks directory" )
581 FC_DECLARE_DERIVED_EXCEPTION( reversible_blocks_backup_dir_exist, reversible_blocks_exception,
582 3180002, "Backup directory for reversible blocks already existg" )
583 FC_DECLARE_DERIVED_EXCEPTION( gap_in_reversible_blocks_db, reversible_blocks_exception,
584 3180003, "Gap in the reversible blocks database" )
585
586 FC_DECLARE_DERIVED_EXCEPTION( block_log_exception, chain_exception,
587 3190000, "Block log exception" )
588 FC_DECLARE_DERIVED_EXCEPTION( block_log_unsupported_version, block_log_exception,
589 3190001, "unsupported version of block log" )
590 FC_DECLARE_DERIVED_EXCEPTION( block_log_append_fail, block_log_exception,
591 3190002, "fail to append block to the block log" )
592 FC_DECLARE_DERIVED_EXCEPTION( block_log_not_found, block_log_exception,
593 3190003, "block log can not be found" )
594 FC_DECLARE_DERIVED_EXCEPTION( block_log_backup_dir_exist, block_log_exception,
595 3190004, "block log backup dir already exists" )
596 FC_DECLARE_DERIVED_EXCEPTION( block_index_not_found, block_log_exception,
597 3190005, "block index can not be found" )
598
599 FC_DECLARE_DERIVED_EXCEPTION( http_exception, chain_exception,
600 3200000, "http exception" )
601 FC_DECLARE_DERIVED_EXCEPTION( invalid_http_client_root_cert, http_exception,
602 3200001, "invalid http client root certificate" )
603 FC_DECLARE_DERIVED_EXCEPTION( invalid_http_response, http_exception,
604 3200002, "invalid http response" )
605 FC_DECLARE_DERIVED_EXCEPTION( resolved_to_multiple_ports, http_exception,
606 3200003, "service resolved to multiple ports" )
607 FC_DECLARE_DERIVED_EXCEPTION( fail_to_resolve_host, http_exception,
608 3200004, "fail to resolve host" )
609 FC_DECLARE_DERIVED_EXCEPTION( http_request_fail, http_exception,
610 3200005, "http request fail" )
611 FC_DECLARE_DERIVED_EXCEPTION( invalid_http_request, http_exception,
612 3200006, "invalid http request" )
613
614 FC_DECLARE_DERIVED_EXCEPTION( resource_limit_exception, chain_exception,
615 3210000, "Resource limit exception" )
616
617 FC_DECLARE_DERIVED_EXCEPTION( contract_api_exception, chain_exception,
618 3230000, "Contract API exception" )
619 FC_DECLARE_DERIVED_EXCEPTION( crypto_api_exception, contract_api_exception,
620 3230001, "Crypto API Exception" )
621 FC_DECLARE_DERIVED_EXCEPTION( db_api_exception, contract_api_exception,
622 3230002, "Database API Exception" )
623 FC_DECLARE_DERIVED_EXCEPTION( arithmetic_exception, contract_api_exception,
624 3230003, "Arithmetic Exception" )
625
626 FC_DECLARE_DERIVED_EXCEPTION( snapshot_exception, chain_exception,
627 3240000, "Snapshot exception" )
628 FC_DECLARE_DERIVED_EXCEPTION( snapshot_validation_exception, snapshot_exception,
629 3240001, "Snapshot Validation Exception" )
630
631 FC_DECLARE_DERIVED_EXCEPTION( protocol_feature_exception, chain_exception,
632 3250000, "Protocol feature exception" )
633 FC_DECLARE_DERIVED_EXCEPTION( protocol_feature_validation_exception, protocol_feature_exception,
634 3250001, "Protocol feature validation exception" )
635 FC_DECLARE_DERIVED_EXCEPTION( protocol_feature_bad_block_exception, protocol_feature_exception,
636 3250002, "Protocol feature exception (invalid block)" )
637 FC_DECLARE_DERIVED_EXCEPTION( protocol_feature_iterator_exception, protocol_feature_exception,
638 3250003, "Protocol feature iterator exception" )
639} } // sysio::chain
std::string one()
Error
Definition calc.cpp:23
#define FC_DECLARE_DERIVED_EXCEPTION_WITH_ERROR_CODE(TYPE, BASE, CODE, WHAT)
Used to generate a useful error report when an exception is thrown.
Definition exception.hpp:58
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
Defines exception's used by fc.
#define FC_DECLARE_DERIVED_EXCEPTION(TYPE, BASE, CODE, WHAT)
return
bytes signature
Definition pke.hpp:17
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
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
@ normal
Definition protocol.hpp:96
#define value
Definition pkcs11.h:157
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
unsigned __int64 uint64_t
Definition stdint.h:136
Immutable except for fc::from_variant.
Definition name.hpp:43
account_query_db::get_accounts_by_authorizers_result results
memcpy((char *) pInfo->slotDescription, s, l)