Scorum
database_exceptions.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #define SCORUM_DECLARE_OP_BASE_EXCEPTIONS(op_name) \
6  FC_DECLARE_DERIVED_EXCEPTION(op_name##_validate_exception, scorum::chain::operation_validate_exception, \
7  4040000 + 100 * protocol::operation::tag<protocol::op_name##_operation>::value, \
8  #op_name "_operation validation exception") \
9  FC_DECLARE_DERIVED_EXCEPTION(op_name##_evaluate_exception, scorum::chain::operation_evaluate_exception, \
10  4050000 + 100 * protocol::operation::tag<protocol::op_name##_operation>::value, \
11  #op_name "_operation evaluation exception")
12 
13 #define SCORUM_DECLARE_OP_VALIDATE_EXCEPTION(exc_name, op_name, seqnum, msg) \
14  FC_DECLARE_DERIVED_EXCEPTION( \
15  op_name##_##exc_name, scorum::chain::op_name##_validate_exception, \
16  4040000 + 100 * protocol::operation::tag<protocol::op_name##_operation>::value + seqnum, msg)
17 
18 #define SCORUM_DECLARE_OP_EVALUATE_EXCEPTION(exc_name, op_name, seqnum, msg) \
19  FC_DECLARE_DERIVED_EXCEPTION( \
20  op_name##_##exc_name, scorum::chain::op_name##_evaluate_exception, \
21  4050000 + 100 * protocol::operation::tag<protocol::op_name##_operation>::value + seqnum, msg)
22 
23 #define SCORUM_DECLARE_INTERNAL_EXCEPTION(exc_name, seqnum, msg) \
24  FC_DECLARE_DERIVED_EXCEPTION(internal_##exc_name, scorum::chain::internal_exception, 4990000 + seqnum, msg)
25 
26 #define SCORUM_TRY_NOTIFY(signal, ...) \
27  try \
28  { \
29  signal(__VA_ARGS__); \
30  } \
31  catch (const scorum::chain::plugin_exception& e) \
32  { \
33  throw; \
34  } \
35  catch (const fc::exception& e) \
36  { \
37  elog("Caught exception in plugin: ${e}", ("e", e.to_detail_string())); \
38  } \
39  catch (...) \
40  { \
41  wlog("Caught unexpected exception in plugin"); \
42  }
43 
44 namespace scorum {
45 namespace chain {
46 
47 FC_DECLARE_EXCEPTION(chain_exception, 4000000, "blockchain exception")
48 FC_DECLARE_DERIVED_EXCEPTION(database_query_exception,
49  scorum::chain::chain_exception,
50  4010000,
51  "database query exception")
52 FC_DECLARE_DERIVED_EXCEPTION(block_validate_exception,
53  scorum::chain::chain_exception,
54  4020000,
55  "block validation exception")
56 FC_DECLARE_DERIVED_EXCEPTION(transaction_exception,
57  scorum::chain::chain_exception,
58  4030000,
59  "transaction validation exception")
60 FC_DECLARE_DERIVED_EXCEPTION(operation_validate_exception,
61  scorum::chain::chain_exception,
62  4040000,
63  "operation validation exception")
64 FC_DECLARE_DERIVED_EXCEPTION(operation_evaluate_exception,
65  scorum::chain::chain_exception,
66  4050000,
67  "operation evaluation exception")
68 FC_DECLARE_DERIVED_EXCEPTION(utility_exception, scorum::chain::chain_exception, 4060000, "utility method exception")
69 FC_DECLARE_DERIVED_EXCEPTION(undo_database_exception,
70  scorum::chain::chain_exception,
71  4070000,
72  "undo database exception")
73 FC_DECLARE_DERIVED_EXCEPTION(unlinkable_block_exception, scorum::chain::chain_exception, 4080000, "unlinkable block")
74 FC_DECLARE_DERIVED_EXCEPTION(unknown_hardfork_exception,
75  scorum::chain::chain_exception,
76  4090000,
77  "chain attempted to apply unknown hardfork")
78 FC_DECLARE_DERIVED_EXCEPTION(plugin_exception, scorum::chain::chain_exception, 4100000, "plugin exception")
79 FC_DECLARE_DERIVED_EXCEPTION(block_log_exception, scorum::chain::chain_exception, 4110000, "block log exception")
80 
81 FC_DECLARE_DERIVED_EXCEPTION(transaction_expiration_exception,
82  scorum::chain::transaction_exception,
83  4030100,
84  "transaction expiration exception")
85 FC_DECLARE_DERIVED_EXCEPTION(transaction_tapos_exception,
86  scorum::chain::transaction_exception,
87  4030200,
88  "transaction tapos exception")
89 
90 FC_DECLARE_DERIVED_EXCEPTION(pop_empty_chain,
91  scorum::chain::undo_database_exception,
92  4070001,
93  "there are no blocks to pop")
94 
96 // SCORUM_DECLARE_OP_EVALUATE_EXCEPTION( from_account_not_whitelisted, transfer, 1, "owner mismatch" )
97 
99 SCORUM_DECLARE_OP_EVALUATE_EXCEPTION(max_auth_exceeded, account_create, 1, "Exceeds max authority fan-out")
100 SCORUM_DECLARE_OP_EVALUATE_EXCEPTION(auth_account_not_found, account_create, 2, "Auth account not found")
101 
103 SCORUM_DECLARE_OP_EVALUATE_EXCEPTION(max_auth_exceeded, account_update, 1, "Exceeds max authority fan-out")
104 SCORUM_DECLARE_OP_EVALUATE_EXCEPTION(auth_account_not_found, account_update, 2, "Auth account not found")
105 
106 FC_DECLARE_DERIVED_EXCEPTION(internal_exception, scorum::chain::chain_exception, 4990000, "internal exception")
107 
108 SCORUM_DECLARE_INTERNAL_EXCEPTION(verify_auth_max_auth_exceeded, 1, "Exceeds max authority fan-out")
109 SCORUM_DECLARE_INTERNAL_EXCEPTION(verify_auth_account_not_found, 2, "Auth account not found")
110 }
111 } // scorum::chain
112 
113 #pragma once
114 
115 #include <fc/exception/exception.hpp>
117 
118 namespace scorum {
119 namespace chain {
120 }
121 } // scorum::chain
tracks the blockchain state in an extensible manner
Definition: database.hpp:52
#define SCORUM_DECLARE_INTERNAL_EXCEPTION(exc_name, seqnum, msg)
#define SCORUM_DECLARE_OP_EVALUATE_EXCEPTION(exc_name, op_name, seqnum, msg)
FC_DECLARE_DERIVED_EXCEPTION(database_query_exception, scorum::chain::chain_exception, 4010000, "database query exception") FC_DECLARE_DERIVED_EXCEPTION(block_validate_exception
block validation exception operation validation exception undo database exception transaction expiration exception there are no blocks to pop SCORUM_DECLARE_OP_BASE_EXCEPTIONS(transfer)
fc::static_variant< vote_operation, comment_operation, transfer_operation, transfer_to_scorumpower_operation, withdraw_scorumpower_operation, account_create_by_committee_operation, account_create_operation, account_create_with_delegation_operation, account_update_operation, witness_update_operation, account_witness_vote_operation, account_witness_proxy_operation, delete_comment_operation, comment_options_operation, set_withdraw_scorumpower_route_to_account_operation, set_withdraw_scorumpower_route_to_dev_pool_operation, prove_authority_operation, request_account_recovery_operation, recover_account_operation, change_recovery_account_operation, escrow_approve_operation, escrow_dispute_operation, escrow_release_operation, escrow_transfer_operation, decline_voting_rights_operation, delegate_scorumpower_operation, create_budget_operation, close_budget_operation, proposal_vote_operation, proposal_create_operation, atomicswap_initiate_operation, atomicswap_redeem_operation, atomicswap_refund_operation, close_budget_by_advertising_moderator_operation, update_budget_operation, create_game_operation, cancel_game_operation, update_game_markets_operation, update_game_start_time_operation, post_game_results_operation, post_bet_operation, cancel_pending_bets_operation, delegate_sp_from_reg_pool_operation, create_nft_operation, update_nft_meta_operation, create_game_round_operation, update_game_round_result_operation, adjust_nft_experience_operation, update_nft_name_operation, author_reward_operation, comment_benefficiary_reward_operation, comment_payout_update_operation, comment_reward_operation, curation_reward_operation, hardfork_operation, producer_reward_operation, active_sp_holders_reward_operation, return_scorumpower_delegation_operation, shutdown_witness_operation, witness_miss_block_operation, expired_contract_refund_operation, acc_finished_vesting_withdraw_operation, devpool_finished_vesting_withdraw_operation, acc_to_acc_vesting_withdraw_operation, devpool_to_acc_vesting_withdraw_operation, acc_to_devpool_vesting_withdraw_operation, devpool_to_devpool_vesting_withdraw_operation, proposal_virtual_operation, budget_outgo_operation, budget_owner_income_operation, active_sp_holders_reward_legacy_operation, budget_closing_operation, bets_matched_operation, game_status_changed_operation, bet_resolved_operation, bet_cancelled_operation, bet_restored_operation, bet_updated_operation > operation
Definition: operations.hpp:112
Definition: asset.cpp:15