Skip to main content

FinTSError

Enum FinTSError 

Source
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.

Fields

§message: String
§

Timeout

An HTTP request did not finish within the transport’s timeout.

§

Http

Fields

§status: u16
§message: String
§

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.

Fields

§found: String
§expected: &'static str
§

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.

Fields

§field: &'static str
§

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

§

AccountNotAddressable

The negotiated version of an order cannot address this account (national vs. international account details, Messages B.3). No lower version is tried.

Fields

§version: u16
§

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.

Fields

§end_to_end_id: String
§message_id: String
§

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

Source

pub fn transport(kind: TransportKind, message: impl Into<String>) -> Self

Source

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.

Source

pub fn bank_error(&self) -> Option<&BankError>

The bank error, if this is one.

Source

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.

Source

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.

Source

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

Source§

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

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

impl Display for FinTSError

Source§

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

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

impl Error for FinTSError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for FinTSError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidTransfer> for FinTSError

Source§

fn from(source: InvalidTransfer) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

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 T
where U: From<T>,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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