pub enum FinTSError {
Show 25 variants
Parse(String),
Serialize(String),
Transport {
kind: TransportKind,
message: String,
},
Timeout,
Http {
status: u16,
message: String,
},
Dialog(String),
Bank(BankError),
VersionMismatch(VersionMismatch),
StateFormat {
found: String,
expected: &'static str,
},
PausedDialogMismatch {
field: &'static str,
},
NoBpd {
code: SegmentType,
},
AccountNotAddressable {
code: SegmentType,
version: u16,
reason: AddressingReason,
},
Internal(String),
InvalidResponse(String),
SegmentUnreadable(CodecError),
Mt940(String),
Camt(String),
Pain002(String),
InvalidTransfer(InvalidTransfer),
PaymentOutcomeUnknown {
end_to_end_id: String,
message_id: String,
},
DecoupledMaxPolls(u32),
DialogPaused,
WrongResume,
DialogEnded,
Io(Error),
}Expand description
Errors that can occur during FinTS operations.
Variants§
Parse(String)
Serialize(String)
Transport
The message did not reach the bank or the answer could not be read
back; kind says which step failed. A request timeout is
FinTSError::Timeout and an HTTP status FinTSError::Http.
Timeout
An HTTP request did not finish within the transport’s timeout.
Http
Dialog(String)
Bank(BankError)
The bank rejected the message or an order (a class 9 code): the
selected code line plus every code of the response. Its category
says what to do (BankError::category).
VersionMismatch(VersionMismatch)
No version of the order is both offered by the bank (BPD) and implemented by this client (Formals C.10). Names both sides. A client-side check before anything is sent.
StateFormat
Stored state (session state) carries another format tag than this version reads, older or newer. There is no migration: start from an empty state.
PausedDialogMismatch
A paused dialog was thawed with a client or credentials it was not
frozen with (field: blz, url or user_id). Nothing was sent.
NoBpd
An order was built without bank parameter data. Orders only run in a dialog opened after synchronisation, so there is no version to choose and none is guessed.
Fields
code: SegmentTypeAccountNotAddressable
The negotiated version of an order cannot address this account (national vs. international account details, Messages B.3). No lower version is tried.
Internal(String)
A bug in this client, for example a segment version it claims to implement but cannot build.
InvalidResponse(String)
SegmentUnreadable(CodecError)
A received segment that matters for the dialog (HITAN) was rejected by its codec definition; carries the segment, field and rule.
Mt940(String)
Camt(String)
Pain002(String)
The payee check report (pain.002) the bank sent could not be read. The raw document is in the trace; no result is guessed.
InvalidTransfer(InvalidTransfer)
The transfer the caller described cannot be sent: a field breaks a rule (SEPA charset, length, IBAN, BIC, amount). Nothing was sent; fix the data and retry.
PaymentOutcomeUnknown
After a message carried a payment order or its TAN, the bank’s
decision is unknown: a transport error, an unreadable answer
(HIRMS, HITAN, HIVPP, pain.002), an answer that fits no case, a
decoupled approval past the bank’s max_polls, or a future the
caller dropped mid-request (reported once, by the next call on the
dialog). Every error after the order but a class 9 rejection is
this one. The bank may or may not execute the payment. Check the
account (by end_to_end_id, pain.001 message_id) before trying
again; the library never resends. The dialog has ended when the
message number is unknown.
DecoupledMaxPolls(u32)
The bank’s maximum of decoupled status requests is used up (a
read or the login; a transfer gets
FinTSError::PaymentOutcomeUnknown).
DialogPaused
A job was started while the dialog waits for a TAN or decoupled
confirmation of another one: resume (submit_tan, poll) or
cancel that job first. Nothing was sent.
WrongResume
The resume ticket does not belong to the job this dialog waits for (another task reference or job, or no job pending). Nothing was sent.
DialogEnded
The dialog is over: the bank ended it (9800), a transport error or a dropped request left its message number unknown, or its login failed. Open a new dialog.
Io(Error)
Implementations§
Source§impl FinTSError
impl FinTSError
Sourcepub fn transport(kind: TransportKind, message: impl Into<String>) -> Self
pub fn transport(kind: TransportKind, message: impl Into<String>) -> Self
A FinTSError::Transport of kind.
Sourcepub fn kind(&self) -> Category
pub fn kind(&self) -> Category
What the caller can do about this error. Bank errors take the category of their selected code; client-side errors have a fixed one.
Sourcepub fn bank_error(&self) -> Option<&BankError>
pub fn bank_error(&self) -> Option<&BankError>
The bank error, if this is one.
Sourcepub fn is_credentials_error(&self) -> bool
pub fn is_credentials_error(&self) -> bool
Whether the bank refused the login data or has blocked the access. Do not repeat the request automatically: each attempt with a wrong PIN counts, and after a few the bank blocks the access until the customer has it unblocked.
Sourcepub fn needs_user(&self) -> bool
pub fn needs_user(&self) -> bool
Whether only the customer can resolve this: a TAN is wanted, or an approval in the app did not come in time. Ask the customer before trying again.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
A temporary failure worth retrying later unchanged: network trouble, timeouts, server errors, rate limiting, a bank system that is briefly unavailable.
Trait Implementations§
Source§impl Debug for FinTSError
impl Debug for FinTSError
Source§impl Display for FinTSError
impl Display for FinTSError
Source§impl Error for FinTSError
impl Error for FinTSError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()