Error

Enum Error 

Source
#[repr(i32)]
pub enum Error {
Show 20 variants InternalError = -1, FieldNotFound = -2, BufferTooSmall = -3, NoArray = -4, NotLeafField = -5, LocatorMalformed = -6, SlotOutRange = -7, SlotsFull = -8, EmptySlot = -9, LedgerObjNotFound = -10, InvalidDecoding = -11, DataFieldTooLarge = -12, PointerOutOfBounds = -13, NoMemoryExported = -14, InvalidParams = -15, InvalidAccount = -16, InvalidField = -17, IndexOutOfBounds = -18, InvalidFloatInput = -19, InvalidFloatComputation = -20,
}
Expand description

Possible errors returned by XRPL Programmability APIs.

Errors are global across all Programmability APIs.

Variants§

§

InternalError = -1

Reserved for internal invariant trips, generally unrelated to inputs. These should be reported with an issue.

§

FieldNotFound = -2

The requested serialized field could not be found in the specified object. This error is returned when attempting to access a field that doesn’t exist in the current transaction or ledger object.

§

BufferTooSmall = -3

The provided buffer is too small to hold the requested data. Increase the buffer size and retry the operation.

§

NoArray = -4

The API was asked to assume the object under analysis is an STArray but it was not. This error occurs when trying to perform array operations on non-array objects.

§

NotLeafField = -5

The specified field is not a leaf field and cannot be accessed directly. Leaf fields are primitive types that contain actual data values.

§

LocatorMalformed = -6

The provided locator string is malformed or invalid. Locators must follow the proper format for field identification.

§

SlotOutRange = -7

The specified slot number is outside the valid range. Slot numbers must be within the allowed bounds for the current context.

§

SlotsFull = -8

No free slots are available for allocation. All available slots are currently in use. Consider reusing existing slots.

§

EmptySlot = -9

The specified slot did not contain any slotted data (i.e., is empty). This error occurs when trying to access a slot that hasn’t been allocated or has been freed.

§

LedgerObjNotFound = -10

The requested ledger object could not be found. This may occur if the object doesn’t exist or the keylet is invalid.

§

InvalidDecoding = -11

An error occurred while decoding serialized data. This typically indicates corrupted or invalidly formatted data.

§

DataFieldTooLarge = -12

The data field is too large to be processed. Consider reducing the size of the data or splitting it into smaller chunks.

§

PointerOutOfBounds = -13

A pointer or buffer length provided as a parameter described memory outside the allowed memory region. This error indicates a memory access violation.

§

NoMemoryExported = -14

No memory has been exported by the WebAssembly module. The module must export its memory for host functions to access it.

§

InvalidParams = -15

One or more of the parameters provided to the API are invalid. Check the API documentation for valid parameter ranges and formats.

§

InvalidAccount = -16

The provided account identifier is invalid. Account IDs must be valid 20-byte addresses in the proper format.

§

InvalidField = -17

The specified field identifier is invalid or not recognized. Field IDs must correspond to valid XRPL serialization fields.

§

IndexOutOfBounds = -18

The specified index is outside the valid bounds of the array or collection. Ensure the index is within the valid range for the target object.

§

InvalidFloatInput = -19

The input provided for floating-point parsing is malformed. Floating-point values must be in the correct format for XFL operations.

§

InvalidFloatComputation = -20

An error occurred during floating-point computation. This may indicate overflow, underflow, or other arithmetic errors.

Implementations§

Source§

impl Error

Source

pub fn from_code(code: i32) -> Self

Source

pub fn code(self) -> i32

Error code

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Error> for i64

Source§

fn from(val: Error) -> Self

Converts to this type from the input type.
Source§

impl Copy for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.