BorsaError

Enum BorsaError 

Source
#[non_exhaustive]
pub enum BorsaError { Unsupported { capability: String, }, Data(String), InvalidArg(String), Connector { connector: String, msg: String, }, Other(String), NotFound { what: String, }, AllProvidersFailed(Vec<BorsaError>), ProviderTimeout { connector: String, capability: String, }, RequestTimeout { capability: String, }, AllProvidersTimedOut { capability: String, }, StrictSymbolsRejected { rejected: Vec<String>, }, }
Expand description

Unified error type for the borsa workspace.

This wraps capability mismatches, argument validation errors, provider-tagged failures, not-found conditions, and an aggregate for multi-provider attempts.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unsupported

The requested capability is not implemented by the target connector.

Fields

§capability: String

A capability string describing what was requested (e.g. “history/crypto”).

§

Data(String)

Issues with the returned or expected data (missing fields, etc.).

§

InvalidArg(String)

Invalid input argument.

§

Connector

An individual connector returned an error.

Fields

§connector: String

Connector name that failed.

§msg: String

Human-readable error message.

§

Other(String)

Unknown/opaque error.

§

NotFound

A resource or symbol could not be found.

Fields

§what: String

Description of missing resource, e.g. “quote for AAPL”.

§

AllProvidersFailed(Vec<BorsaError>)

All selected providers failed; contains the individual failures.

§

ProviderTimeout

An individual provider call exceeded the configured timeout.

Fields

§connector: String

Connector name that timed out.

§capability: String

Capability label (e.g. “history”, “search”, “quote”).

§

RequestTimeout

The overall request exceeded the configured deadline.

Fields

§capability: String

Capability label for which the request timed out.

§

AllProvidersTimedOut

All attempted providers timed out for the requested capability.

Fields

§capability: String

Capability label that timed out across all providers.

§

StrictSymbolsRejected

Strict routing policy rejected one or more requested symbols for streaming.

Fields

§rejected: Vec<String>

List of symbol strings that were excluded by strict routing rules.

Implementations§

Source§

impl BorsaError

Source

pub fn unsupported(cap: impl Into<String>) -> Self

Helper: build an Unsupported error for a capability string.

Source

pub fn connector(connector: impl Into<String>, msg: impl Into<String>) -> Self

Helper: build a Connector error with the connector name and message.

Source

pub fn not_found(what: impl Into<String>) -> Self

Helper: build a NotFound error for a description of the missing resource.

Source

pub fn provider_timeout( connector: impl Into<String>, capability: impl Into<String>, ) -> Self

Helper: build a ProviderTimeout error.

Source

pub fn request_timeout(capability: impl Into<String>) -> Self

Helper: build a RequestTimeout error.

Source

pub fn is_actionable(&self) -> bool

Returns true if this error should be surfaced to users as actionable.

Non-actionable errors are those indicating capability absence or a benign not-found condition. Aggregates are classified based on their contents.

Source

pub fn flatten(self) -> Vec<Self>

Flatten nested AllProvidersFailed structures into a plain vector.

This preserves other error variants as-is and unwraps recursively.

Trait Implementations§

Source§

impl Clone for BorsaError

Source§

fn clone(&self) -> BorsaError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BorsaError

Source§

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

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

impl<'de> Deserialize<'de> for BorsaError

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 Display for BorsaError

Source§

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

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

impl Error for BorsaError

1.30.0 · 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
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<DomainError> for BorsaError

Source§

fn from(e: DomainError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for BorsaError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<MarketError> for BorsaError

Source§

fn from(e: MarketError) -> Self

Converts to this type from the input type.
Source§

impl From<MoneyError> for BorsaError

Source§

fn from(e: MoneyError) -> Self

Converts to this type from the input type.
Source§

impl From<PaftError> for BorsaError

Source§

fn from(e: PaftError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BorsaError

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for BorsaError

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 BorsaError

Source§

impl StructuralPartialEq for BorsaError

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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 = Infallible

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

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

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,