Enum Error

Source
#[repr(i32)]
pub enum Error {
Show 33 variants OutOfBounds = -1, InternalError = -2, TooBig = -3, TooSmall = -4, DoesntExist = -5, NoFreeSlots = -6, InvalidArgument = -7, AlreadySet = -8, PrerequisiteNotMet = -9, FeeTooLarge = -10, EmissionFailure = -11, TooManyNonces = -12, TooManyEmittedTxn = -13, NotImplemented = -14, InvalidAccount = -15, GuardViolation = -16, InvalidField = -17, ParseError = -18, RcRollback = -19, RcAccept = -20, NoSuchKeylet = -21, NotAnArray = -22, NotAnObject = -23, InvalidFloat = -10_024, DivisionByZero = -25, ManitssaOversized = -26, MantissaUndersized = -27, ExponentOversized = -28, ExponentUndersized = -29, Overflow = -30, NotIouAmount = -31, NotAnAmount = -32, CantReturnNegative = -33,
}
Expand description

Possible errors returned by Hook APIs.

Errors are global across all Hook APIs.

Variants§

§

OutOfBounds = -1

A pointer or buffer length provided as a parameter described memory outside of the Hook’s allowed memory region.

§

InternalError = -2

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

§

TooBig = -3

Attempted to set a parameter or value larger than the allowed space .

§

TooSmall = -4

The API was unable to produce output to the write_ptr because the specified write_len was too small

§

DoesntExist = -5

The requested object or item wasn’t found

§

NoFreeSlots = -6

The Hook attempted to allocate an item into a slot, but there were no slots free. To avoid ensure re-use of existing slots. The maximum number of slots is 255.

§

InvalidArgument = -7

One or more of the parameters to the API were invalid according to the individual API’s specification.

§

AlreadySet = -8

Some APIs allow for a once-per-execution parameter to be set. A second attempt to set a once-per-execution parameter results in this error.

§

PrerequisiteNotMet = -9

An API required the Hook to do something before the API is allowed to be called. Check the API’s documentation.

§

FeeTooLarge = -10

During fee calculation if an absurdly large fee is calculated this error is returned.

§

EmissionFailure = -11

An attempt to emit() a TXN was unsccessful for any of a number of reasons. Check the trace log of the rippled to which you are submitting the originating TXN.

§

TooManyNonces = -12

A Hook may only use up to 256 calls to nonce() per execution. Further calls result in this error code.

§

TooManyEmittedTxn = -13

A Hook must declare ahead of time how many TXN it intends to emit(). If it emits fewer than this many, this is allowed. If it emits more than this many this error is returned.

§

NotImplemented = -14

While Hooks is/was in development an API may return this if some or all of that API is planned but not yet implemented.

§

InvalidAccount = -15

An API which accepts a 20 byte Account ID may return this if, in its opinion, the Account ID was not valid for any reason.

§

GuardViolation = -16

All loops inside a Hook must declare at the top of the loop, as the first non trivial instruction, before any branch instruction, the promised maximum number of iterations of the loop. If this promise is violated the hook terminates immediately with this error code.

§

InvalidField = -17

The requested serialized field could not be found in the specified object.

§

ParseError = -18

While parsing serialized content an error was encountered (typically indicating an invalidly serialized object).

§

RcRollback = -19

Used internally to communicate a rollback event.

§

RcAccept = -20

Used internally to communicate an accept event.

§

NoSuchKeylet = -21

Specified keylet could not be found, or keylet is invalid

§

NotAnArray = -22

API was asked to assume object under analysis is an STArray but it was not.

§

NotAnObject = -23

API was asked to assume object under analysis is an STObject but it was not.

§

InvalidFloat = -10_024

A floating point operation resulted in Not-A-Number or API call attempted to specify an XFL floating point number outside of the expressible range of XFL.

§

DivisionByZero = -25

API call would result in a division by zero, so API ended early.

§

ManitssaOversized = -26

When attempting to create an XFL the mantissa must be 16 decimal digits.

§

MantissaUndersized = -27

When attempting to create an XFL the mantissa must be 16 decimal digits.

§

ExponentOversized = -28

When attempting to create an XFL the exponent must not exceed 80.

§

ExponentUndersized = -29

When attempting to create an XFL the exponent must not be less than -96.

§

Overflow = -30

A floating point operation done on an XFL resulted in a value larger than XFL format is able to represent.

§

NotIouAmount = -31

An API assumed an STAmount was an IOU when in fact it was XRP.

§

NotAnAmount = -32

An API assumed an STObject was an STAmount when in fact it was not.

§

CantReturnNegative = -33

An API would have returned a negative integer except that negative integers are reserved for error codes (i.e. what you are reading.)

Implementations§

Source§

impl Error

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 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.