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<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<ErrorCode> for ErrorCode
impl PartialEq<ErrorCode> for ErrorCode
impl Eq for ErrorCode
impl StructuralEq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.