Skip to content

Commit 87affb6

Browse files
Added table of standard error codes to end of custom error codes topic. (#350)
* Added table of standard error codes to end of custom error codes topic. * Update error codes * Use correct error codes for V0 and V1 contracts --------- Co-authored-by: Kasper Dissing Bargsteen <[email protected]>
1 parent 5c866af commit 87affb6

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

source/mainnet/smart-contracts-v0/guides/custom-errors.rst

+24
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,27 @@ Return custom errors, as you would with any other error type:
5555
_ctx: &impl HasReceiveContext<()>,
5656
_state: &mut State,
5757
) -> Result<A, MyError> { Err(MyError::ErrTwo) }
58+
59+
Standard error codes
60+
====================
61+
62+
The following standard error codes exist:
63+
64+
=========================================== ===========================
65+
Variant Error code
66+
=========================================== ===========================
67+
() i32::MIN + 1 (-2147483647)
68+
ParseError i32::MIN + 2 (-2147483646)
69+
LogError::Full i32::MIN + 3 (-2147483645)
70+
LogError::Malformed i32::MIN + 4 (-2147483644)
71+
NewContractNameError::MissingInitPrefix i32::MIN + 5 (-2147483643)
72+
NewContractNameError::TooLong i32::MIN + 6 (-2147483642)
73+
NewContractNameError::ContainsDot i32::MIN + 9 (-2147483639)
74+
NewContractNameError::InvalidCharacters i32::MIN + 10 (-2147483638)
75+
NewReceiveNameError::MissingDotSeparator i32::MIN + 7 (-2147483641)
76+
NewReceiveNameError::TooLong i32::MIN + 8 (-2147483640)
77+
NewReceiveNameError::InvalidCharacters i32::MIN + 11 (-2147483637)
78+
NotPayableError i32::MIN + 12 (-2147483636)
79+
=========================================== ===========================
80+
81+
The error codes are also listed in `the library documentation on docs.rs <https://docs.rs/concordium-std/2.0.0/concordium_std/index.html#signalling-errors>`_.

source/mainnet/smart-contracts/guides/custom-errors.rst

+38
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,41 @@ Return custom errors, as you would with any other error type:
6363

6464
Adding :ref:`schemas<build-schema>` to your errors makes them more useful in
6565
``concordium-client`` and ``cargo-concordium``.
66+
67+
Standard error codes
68+
====================
69+
70+
The following standard error codes exist:
71+
72+
=========================================== ===========================
73+
Variant Error code
74+
=========================================== ===========================
75+
() i32::MIN + 1 (-2147483647)
76+
ParseError i32::MIN + 2 (-2147483646)
77+
LogError::Full i32::MIN + 3 (-2147483645)
78+
LogError::Malformed i32::MIN + 4 (-2147483644)
79+
NewContractNameError::MissingInitPrefix i32::MIN + 5 (-2147483643)
80+
NewContractNameError::TooLong i32::MIN + 6 (-2147483642)
81+
NewContractNameError::ContainsDot i32::MIN + 9 (-2147483639)
82+
NewContractNameError::InvalidCharacters i32::MIN + 10 (-2147483638)
83+
NewReceiveNameError::MissingDotSeparator i32::MIN + 7 (-2147483641)
84+
NewReceiveNameError::TooLong i32::MIN + 8 (-2147483640)
85+
NewReceiveNameError::InvalidCharacters i32::MIN + 11 (-2147483637)
86+
NotPayableError i32::MIN + 12 (-2147483636)
87+
TransferError::AmountTooLarge i32::MIN + 13 (-2147483635)
88+
TransferError::MissingAccount i32::MIN + 14 (-2147483634)
89+
CallContractError::AmountTooLarge i32::MIN + 15 (-2147483633)
90+
CallContractError::MissingAccount i32::MIN + 16 (-2147483632)
91+
CallContractError::MissingContract i32::MIN + 17 (-2147483631)
92+
CallContractError::MissingEntrypoint i32::MIN + 18 (-2147483630)
93+
CallContractError::MessageFailed i32::MIN + 19 (-2147483629)
94+
CallContractError::LogicReject i32::MIN + 20 (-2147483628)
95+
CallContractError::Trap i32::MIN + 21 (-2147483627)
96+
UpgradeError::MissingModule i32::MIN + 22 (-2147483626)
97+
UpgradeError::MissingContract i32::MIN + 23 (-2147483625)
98+
UpgradeError::UnsupportedModuleVersion i32::MIN + 24 (-2147483624)
99+
QueryAccountBalanceError i32::MIN + 25 (-2147483623)
100+
QueryContractBalanceError i32::MIN + 26 (-2147483622)
101+
=========================================== ===========================
102+
103+
The error codes are also listed in `the library documentation on docs.rs <https://docs.rs/concordium-std/latest/concordium_std/#signalling-errors>`_.

0 commit comments

Comments
 (0)