Enum offchain::types::ErrorCode [−][src]
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
One of the following potential errors:
X-REQUEST-SENDER-ADDRESSheader 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-ADDRESSheader value. - Could not find the compliance key of the onchain account found by the
X-REQUEST-SENDER-ADDRESSheader value. - The compliance key found from the onchain account by
X-REQUEST-SENDER-ADDRESSis not a valid ED25519 public key. X-REQUEST-IDis not a valid UUID format.
Missing HTTP header X-REQUEST-ID or X-REQUEST-SENDER-ADDRESS.
Invalid JWS format (compact) or protected header
JWS signature verification failed
Request content is not valid Json
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.
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.
A field is unknown for an object.
Invalid/unsupported command_type.
- 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.
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.
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.
PaymentActionObject#amount is under travel rule threshold, no kyc needed for the transaction
Either:
- Field recipient_signature value is not hex-encoded bytes.
- Field recipient_signature value is an invalid signature.
- 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.
- 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.
Field payment.action.currency value is a valid Diem currency code, but it is not supported or acceptable by the receiver VASP.
- 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.
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.
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 Error Code
Trait Implementations
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>,
Deserialize this value from the given Serde deserializer. Read more