pub enum ErrorCode {
Show 24 variants Unauthorized, TokenInvalid, RateLimitExceeded, InternalError, OrderIdempotencyViolation, PinMissing, PinNotSet, PinInvalid, WithdrawInsufficientFunds, WithdrawLimitExceeded, WithdrawRequestLimitExceeded, ForbiddenInCurrentState, PlanNotAllowed, InsufficientHoldings, OrderExpirationDateInvalid, OrderTotalPriceLimitExceeded, ForbiddenForVenue, TradingDisabled, OrderLimitExceeded, InstrumentNotTradable, AccountInsufficientFunds, TradingBlocked, OrderNotInactive, OrderNotTerminated,
}
Expand description

Error codes for the Lemon API

Variants

Unauthorized

The API key is not provided in the HTTP header, cannot be decoded by the backend, or the API Key does not exist.

TokenInvalid

The API key is revoked or user is deleted/suspended.

RateLimitExceeded

The API key has exceeded its rate limit. Please respect the value of the Retry-After header before performing another request.

InternalError

An error occurred in the backend. This is not your fault. We will investigate this.

OrderIdempotencyViolation

Same idempotency has been used within current 7 day period.

PinMissing

Cannot withdraw money because the PIN is not provided in the request (money only).

PinNotSet

Cannot withdraw money because the PIN is not set (money only)

PinInvalid

Cannot withdraw money because the pin verification failed

WithdrawInsufficientFunds

Cannot withdraw money because there are insufficient funds on the account

WithdrawLimitExceeded

Cannot withdraw money because the daily payout limit is exceeded

WithdrawRequestLimitExceeded

Cannot withdraw money because the maximal daily request limit is exceeded

ForbiddenInCurrentState

Cannot update address_country when trading is enabled or user is onboarded

PlanNotAllowed

Cannot update trading plan to basic/pro

InsufficientHoldings

insufficient instrument holdings [on order sell]

OrderExpirationDateInvalid

cannot place order if one expires before market opens again

OrderTotalPriceLimitExceeded

cannot place/activate buy order if estimated total price is greater than 25k Euro

ForbiddenForVenue

cannot place order in ALLDAY for MONEY env

TradingDisabled

cannot place order if trading is not enabled

OrderLimitExceeded

maximum daily amount of orders reached

InstrumentNotTradable

failed to place order if instrument is not tradable

AccountInsufficientFunds

cannot place/activate buy order because of insufficient account funds

TradingBlocked

cannot place/activate order because trading is blocked globally

OrderNotInactive

cannot activate order if its status != inactive

OrderNotTerminated

cannot delete order if its not in cancelling/cancelled/expired/executed/rejected state

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Serialize this value into the given Serde serializer. 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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more