#[repr(u32)]
pub enum ErrorCode {
Show 27 variants NoAdapterResult, WrongProgramAdapterResult, UnauthorizedInvocation, IndirectInvocation, MaxPositions, UnknownPosition, CloseNonZeroPosition, PositionAlreadyRegistered, AccountNotEmpty, PositionNotRegistered, CloseRequiredPosition, InvalidPositionOwner, PositionNotRegisterable, InvalidPositionAdapter, OutdatedPrice, InvalidPrice, OutdatedBalance, Unhealthy, Healthy, Liquidating, NotLiquidating, StalePositions, UnauthorizedLiquidator, LiquidationLostValue, WrongAirspace, InvalidConfig, InvalidOracle,
}

Variants

NoAdapterResult

141000 - An adapter did not return anything

WrongProgramAdapterResult

141001

UnauthorizedInvocation

141002

IndirectInvocation

141003

MaxPositions

141010 - Account cannot record any additional positions

UnknownPosition

141011 - Account has no record of the position

CloseNonZeroPosition

141012 - Attempting to close a position that has a balance

PositionAlreadyRegistered

141013 - Attempting to re-register a position

AccountNotEmpty

141014 - Attempting to close a margin account that isn’t empty

PositionNotRegistered

141015 - Attempting to use a position not registered by the account

CloseRequiredPosition

141016 - Attempting to close a position that is required by the adapter

InvalidPositionOwner

141017

PositionNotRegisterable

141018

InvalidPositionAdapter

141020 - The adapter providing a position change is not authorized for this asset

OutdatedPrice

141021 - A position price is not up-to-date

InvalidPrice

141022 - An asset has an invalid price.

OutdatedBalance

141023 - A position balance is not up-to-date

Unhealthy

141030 - The account is not healthy

Healthy

141031 - The account is already healthy

Liquidating

141032 - The account is being liquidated

NotLiquidating

141033 - The account is not being liquidated

StalePositions

141034 - The account has stale positions

UnauthorizedLiquidator

141040 - No permission to perform a liquidation action

LiquidationLostValue

141041 - The liquidation attempted to extract too much value

WrongAirspace

141050 - The airspace does not match

InvalidConfig

141051 - Attempting to use or set configuration that is not valid

InvalidOracle

141051 - Attempting to use or set an oracle that is not valid

Implementations

Gets the name of this [#enum_name].

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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.