Enum xrpl_hooks::api::Error[][src]

#[repr(i32)]
pub enum Error {
Show 33 variants OutOfBounds, InternalError, TooBig, TooSmall, DoesntExist, NoFreeSlots, InvalidArgument, AlreadySet, PrerequisiteNotMet, FeeTooLarge, EmissionFailure, TooManyNonces, TooManyEmittedTxn, NotImplemented, InvalidAccount, GuardViolation, InvalidField, ParseError, RcRollback, RcAccept, NoSuchKeylet, NotAnArray, NotAnObject, InvalidFloat, DivisionByZero, ManitssaOversized, MantissaUndersized, ExponentOversized, ExponentUndersized, Overflow, NotIouAmount, NotAnAmount, CantReturnNegative,
}
Expand description

Possible errors returned by Hook APIs.

Errors are global across all Hook APIs.

Variants

OutOfBounds

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

InternalError

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

TooBig

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

TooSmall

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

DoesntExist

The requested object or item wasn’t found

NoFreeSlots

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

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

AlreadySet

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

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

FeeTooLarge

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

EmissionFailure

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

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

TooManyEmittedTxn

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

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

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

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

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

ParseError

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

RcRollback

Used internally to communicate a rollback event.

RcAccept

Used internally to communicate an accept event.

NoSuchKeylet

Specified keylet could not be found, or keylet is invalid

NotAnArray

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

NotAnObject

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

InvalidFloat

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

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

ManitssaOversized

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

MantissaUndersized

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

ExponentOversized

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

ExponentUndersized

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

Overflow

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

NotIouAmount

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

NotAnAmount

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

CantReturnNegative

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

Implementations

Error code

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.