Skip to main content Module error_codes Copy item path Source BUFFER_TOO_SMALL The provided buffer is too small to hold the requested data. DATA_FIELD_TOO_LARGE The data field is too large to be processed. EMPTY_SLOT The specified slot did not contain any slotted data (i.e., is empty). FIELD_NOT_FOUND The requested serialized field could not be found in the specified object. INDEX_OUT_OF_BOUNDS The specified index is outside the valid bounds of the array or collection. INVALID_ACCOUNT The provided account identifier is invalid. INVALID_DECODING A byte slice the host returned could not be decoded into the requested type. INVALID_FIELD The specified field identifier is invalid or not recognized. INVALID_FLOAT_COMPUTATION An error occurred during floating-point computation. INVALID_FLOAT_INPUT The input provided for floating-point parsing is malformed. INVALID_PARAMS One or more of the parameters provided to the API are invalid. LEDGER_OBJ_NOT_FOUND The requested ledger object could not be found. LOCATOR_MALFORMED The provided locator string is malformed or invalid. NOT_LEAF_FIELD The specified field is not a leaf field and cannot be accessed directly. NO_ARRAY The API was asked to assume the object under analysis is an STArray but it was not. NO_MEM_EXPORTED No memory has been exported by the WebAssembly module. OUT_OF_TRANSFER_LIMIT The operation would exceed the allowed transfer limit. POINTER_OUT_OF_BOUNDS A pointer or buffer length provided as a parameter described memory outside the allowed memory region. SLOTS_FULL No free slots are available for allocation. SLOT_OUT_RANGE The specified slot number is outside the valid range. SOME_ERROR Stand-in for “the host returned some error”, for tests that assert an error propagates rather
than any particular code. The value is arbitrary; it only has to be a real host code the stdlib
never constructs itself, so a passing test can’t be explained by the code under test producing
it independently. FIELD_NOT_FOUND cannot be used — the optional getters turn it into
Ok(None). UNIMPLEMENTED The host function has an empty/stub implementation (not yet implemented by the host). match_result_code Evaluates a result code and executes a closure on success (result_code > 0). match_result_code_optional Evaluates a result code and executes a closure on success, handling optional return values. match_result_code_with_expected_bytes Evaluates a result code against an expected number of bytes and executes a closure on exact match. match_result_code_with_expected_bytes_optional Evaluates a result code against expected bytes with optional field handling.