pub enum ErrorCode {
Show 21 variants InvalidHttpHeader, MissingHttpHeader, InvalidJws, InvalidJwsSignature, InvalidJson, InvalidObject, MissingField, UnknownField, UnknownCommandType, InvalidFieldValue, InvalidCommandProducer, InvalidInitialOrPriorNotFound, NoKycNeeded, InvalidRecipientSignature, UnknownAddress, Conflict, UnsupportedCurrency, InvalidOriginalPaymentReferenceId, InvalidOverwrite, InvalidTransition, Unknown,
}

Variants§

§

InvalidHttpHeader

One of the following potential errors:

  • X-REQUEST-SENDER-ADDRESS header value is not the request sender’s address in the command object. All command objects should have a field that is the request sender’s address.
  • Could not find Diem’s onchain account by the X-REQUEST-SENDER-ADDRESS header value.
  • Could not find the compliance key of the onchain account found by the X-REQUEST-SENDER-ADDRESS header value.
  • The compliance key found from the onchain account by X-REQUEST-SENDER-ADDRESS is not a valid ED25519 public key.
  • X-REQUEST-ID is not a valid UUID format.
§

MissingHttpHeader

Missing HTTP header X-REQUEST-ID or X-REQUEST-SENDER-ADDRESS.

§

InvalidJws

Invalid JWS format (compact) or protected header

§

InvalidJwsSignature

JWS signature verification failed

§

InvalidJson

Request content is not valid Json

§

InvalidObject

Object is not valid, type does not match The Command request/response object json is not an object, or the command object type does not match command_type.

§

MissingField

Either:

  • Missing required field
  • An optional field is required to be set for a specific state, e.g. PaymentObject requires sender’s kyc_data (which is an optional field for PaymentActorObject) when sender init the PaymentObject.
§

UnknownField

A field is unknown for an object.

§

UnknownCommandType

Invalid/unsupported command_type.

§

InvalidFieldValue

  • Invalid / unknown enum field values.
  • UUID field value does not match UUID format.
  • Payment actor address is not a valid DIP-5 account identifier.
  • Currency field value is not a valid Diem currency code for the connected network.
§

InvalidCommandProducer

The HTTP request sender is not the right actor to send the payment object. For example, if the actor receiver sends a new command with payment object change that should be done by actor sender.

§

InvalidInitialOrPriorNotFound

could not find command by reference_id for a non-initial state command object; for example, actor receiver received a payment command object that actor sender status is ready_for_settlement, but receiver could not find any command object by the reference id.

§

NoKycNeeded

PaymentActionObject#amount is under travel rule threshold, no kyc needed for the transaction

§

InvalidRecipientSignature

Either:

  • Field recipient_signature value is not hex-encoded bytes.
  • Field recipient_signature value is an invalid signature.
§

UnknownAddress

  • The DIP-5 account identifier address in the command object is not HTTP request sender’s address or receiver’s address. For payment object it is sender.address or receiver.address.
  • Could not find on-chain account by an DIP-5 account identifier address in command object address.
§

Conflict

  • Command object is in conflict with another different command object by cid, likely a cid is reused for different command object.
  • Failed to acquire lock for the command object by the reference_id.
§

UnsupportedCurrency

Field payment.action.currency value is a valid Diem currency code, but it is not supported or acceptable by the receiver VASP.

§

InvalidOriginalPaymentReferenceId

  • Could not find data by the original_payment_reference_id if the sender set it.
  • The status of the original payment object found by original_payment_reference_id is aborted instead of ready_for_settlement.
§

InvalidOverwrite

Overwrite a write-once/immutable field value

  • Overwrite a field that can only be written once.
  • Overwrite an immutable field (field can only be set in initial command object), e.g. original_payment_reference_id).
  • Overwrite opponent payment actor’s fields.
§

InvalidTransition

As we only allow one actor action at a time, and the next states for a given command object state are limited to specific states. This error indicates the new payment object state is not valid according to the current object state. For example: VASP A sends RSOFT to VASP B, VASP B should send the next payment object with ABORT, or SSOFTSEND; VASP A should respond to this error code if VASP B sends payment object state SSOFT.

§

Unknown

Unknown Error Code

Trait Implementations§

source§

impl Debug for ErrorCode

source§

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

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

impl<'de> Deserialize<'de> for ErrorCode

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<ErrorCode> for ErrorCode

source§

fn eq(&self, other: &ErrorCode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ErrorCode

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for ErrorCode

source§

impl StructuralEq for ErrorCode

source§

impl StructuralPartialEq for ErrorCode

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

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

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,

§

fn test_only_hash(&self) -> HashValue

Generates a hash used only for tests.
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,