pub enum YahooError {
Show 13 variants
AuthenticationFailed {
context: String,
},
SymbolNotFound {
symbol: Option<String>,
context: String,
},
RateLimited {
retry_after: Option<u64>,
},
HttpError(Error),
JsonParseError(Error),
ResponseStructureError {
field: String,
context: String,
},
InvalidParameter {
param: String,
reason: String,
},
Timeout {
timeout_ms: u64,
},
ServerError {
status: u16,
context: String,
},
UnexpectedResponse(String),
InternalError(String),
ApiError(String),
RuntimeError(Error),
}Expand description
Main error type for the library
Variants§
AuthenticationFailed
Authentication with Yahoo Finance failed
SymbolNotFound
The requested symbol was not found
RateLimited
Rate limit exceeded
HttpError(Error)
HTTP request error
JsonParseError(Error)
Failed to parse JSON response
ResponseStructureError
Response structure error - missing or malformed fields
InvalidParameter
Invalid parameter provided
Timeout
Network timeout
ServerError
Server error (5xx status codes)
UnexpectedResponse(String)
Unexpected response from Yahoo Finance
InternalError(String)
Internal error
ApiError(String)
API error from Yahoo Finance
RuntimeError(Error)
Tokio runtime error
Implementations§
Source§impl YahooError
impl YahooError
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Check if this error is retriable
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
Check if this error indicates an authentication issue
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this error indicates a not found issue
Sourcepub fn retry_after_secs(&self) -> Option<u64>
pub fn retry_after_secs(&self) -> Option<u64>
Get retry delay in seconds (for exponential backoff)
Sourcepub fn category(&self) -> ErrorCategory
pub fn category(&self) -> ErrorCategory
Categorize errors for logging/metrics
Sourcepub fn with_symbol(self, symbol: impl Into<String>) -> Self
pub fn with_symbol(self, symbol: impl Into<String>) -> Self
Add symbol context to error (fluent API)
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Add context to error (fluent API)
Source§impl YahooError
impl YahooError
Sourcepub fn parse_error(msg: impl Into<String>) -> Self
👎Deprecated since 2.0.0: Use ResponseStructureError instead
pub fn parse_error(msg: impl Into<String>) -> Self
Create a ParseError from a string (for backward compatibility)
Trait Implementations§
Source§impl Debug for YahooError
impl Debug for YahooError
Source§impl Display for YahooError
impl Display for YahooError
Source§impl Error for YahooError
impl Error for YahooError
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
Source§impl From<Error> for YahooError
impl From<Error> for YahooError
Source§impl From<Error> for YahooError
impl From<Error> for YahooError
Source§impl From<Error> for YahooError
impl From<Error> for YahooError
Source§impl From<StreamError> for YahooError
impl From<StreamError> for YahooError
Source§fn from(e: StreamError) -> Self
fn from(e: StreamError) -> Self
Auto Trait Implementations§
impl Freeze for YahooError
impl !RefUnwindSafe for YahooError
impl Send for YahooError
impl Sync for YahooError
impl Unpin for YahooError
impl !UnwindSafe for YahooError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.