multiversx_sc/
err_msg.rs

1pub const PANIC_OCCURRED: &str = "panic occurred";
2pub const MEM_ALLOC_ERROR: &str = "memory allocation error";
3
4pub const NON_PAYABLE_FUNC_ESDT: &str = "function does not accept ESDT payment";
5pub const BAD_TOKEN_PROVIDED: &str = "bad call value token provided";
6pub const BAD_TOKEN_TICKER_FORMAT: &str = "bad token ticker format";
7pub const SINGLE_ESDT_EXPECTED: &str = "function expects single ESDT payment";
8pub const TOO_MANY_ESDT_TRANSFERS: &str = "too many ESDT transfers";
9pub const ESDT_INVALID_TOKEN_INDEX: &str = "invalid token index";
10pub const ESDT_UNEXPECTED_EGLD: &str = "unexpected EGLD transfer";
11pub const INCORRECT_NUM_ESDT_TRANSFERS: &str = "incorrect number of ESDT transfers";
12pub const INCORRECT_NUM_TRANSFERS: &str = "incorrect number of transfers";
13pub const FUNGIBLE_TOKEN_EXPECTED_ERR_MSG: &str = "fungible ESDT token expected";
14pub const TOKEN_IDENTIFIER_ESDT_EXPECTED: &str = "ESDT expected";
15
16pub const ARG_WRONG_NUMBER: &str = "wrong number of arguments";
17pub const ARG_ASYNC_WRONG_NUMBER: &str = "wrong number of arguments provided to async call";
18pub const ARG_ASYNC_RETURN_WRONG_NUMBER: &str = "wrong number of arguments returned by async call";
19pub const ARG_CALLBACK_TOO_FEW: &str = "too few callback arguments provided";
20pub const ARG_CALLBACK_TOO_MANY: &str = "too many callback arguments provided";
21
22pub const ARG_OUT_OF_RANGE: &str = "argument out of range";
23pub const ARG_BAD_LENGTH: &str = "argument has wrong length";
24pub const ARG_BAD_LENGTH_32: &str = "argument has wrong length: 32 bytes expected";
25pub const ARG_DECODE_ERROR_1: &str = "argument decode error (";
26pub const ARG_DECODE_ERROR_2: &str = "): ";
27pub const STORAGE_VALUE_OUT_OF_RANGE: &str = "storage value out of range";
28pub const STORAGE_DECODE_ERROR_1: &str = "storage decode error (key: ";
29pub const STORAGE_DECODE_ERROR_2: &str = "): ";
30pub const STORAGE_ENCODE_ERROR: &str = "storage encode error: ";
31pub const STORAGE_KEY_ENCODE_ERROR: &str = "storage key encode error: ";
32pub const STORAGE_VALUE_EXCEEDS_BUFFER: &str = "storage value exceeds buffer";
33pub const FINISH_ENCODE_ERROR: &str = "endpoint result encode error: ";
34pub const SERIALIZER_DECODE_ERROR: &str = "serializer decode error: ";
35pub const SERIALIZER_ENCODE_ERROR: &str = "serializer encode error: ";
36pub const FORMATTER_ENCODE_ERROR: &str = "formatter encode error: ";
37pub const LOG_TOPIC_ENCODE_ERROR: &str = "log topic encode error: ";
38pub const LOG_DATA_ENCODE_ERROR: &str = "log data encode error: ";
39pub const CONTRACT_CALL_ENCODE_ERROR: &str = "contract call encode error: ";
40
41pub const VALUE_EXCEEDS_SLICE: &str = "value exceeds target slice";
42pub const CAST_TO_I64_ERROR: &str = "cast to i64 error";
43pub const BIG_UINT_EXCEEDS_SLICE: &str = "big uint as_bytes exceed target slice";
44pub const BIG_UINT_SUB_NEGATIVE: &str = "cannot subtract because result would be negative";
45pub const UNSIGNED_NEGATIVE: &str = "cannot convert to unsigned, number is negative";
46
47pub const DESERIALIZATION_INVALID_BYTE: &str = "call data deserialization error: not a valid byte";
48pub const DESERIALIZATION_NOT_32_BYTES: &str =
49    "call data deserialization error: 32 as_bytes expected";
50pub const DESERIALIZATION_ODD_DIGITS: &str =
51    "call data deserialization error: odd number of digits in hex representation";
52pub const DESERIALIZATION_ARG_OUT_OF_RANGE: &str =
53    "call data deserialization error: argument out of range";
54
55pub const CALLBACK_BAD_FUNC: &str = "no callback function with that name exists in contract";
56
57pub const RECIPIENT_ADDRESS_NOT_SET: &str = "recipient address not set";
58pub static ONLY_OWNER_CALLER: &str = "Endpoint can only be called by owner";
59pub static ONLY_USER_ACCOUNT_CALLER: &str = "Endpoint can only be called by user accounts";
60
61pub const STORAGE_NOT_I64: &str = "storage not i64";
62pub const STORAGE_NOT_32_BYTES: &str = "32 bytes of data expected in storage at key";
63
64/// An additional non-VM status, meant just to signal an error in the debugger infrastructure of in the tests.
65pub const DEBUG_API_ERR_STATUS: u64 = 100;
66pub const DEBUG_API_ERR_HANDLE_STALE: &str =
67    "VMHooksApi misuse: operation called with a handle that does not point to the top context of the call stack";
68pub const DEBUG_API_ERR_HANDLE_CONTEXT_MISMATCH: &str =
69    "VMHooksApi misuse: operation called with handles from 2 different contexts";