pub enum Error {
Sqlite(Error),
Json(Error),
Http(Error),
Validation(String),
NotFound,
ConflictingExternalId {
provider: String,
source_id: String,
},
Sync(String),
}Expand description
The library’s unified error type.
Operations that can fail expose animedb::Result<T> (alias for
std::result::Result<T, Error>) as their return type.
Variants§
Sqlite(Error)
SQLite error (connection, statement, or transaction failure).
Json(Error)
JSON serialization or deserialization failure.
Http(Error)
HTTP request failure (network error, TLS error, non-2xx status).
Validation(String)
Input validation failure — returned when required fields are missing, enum variants cannot be parsed, or a sync source mismatch is detected.
NotFound
A requested media record was not found in the local database.
ConflictingExternalId
An external ID resolves to different media records depending on the
media kind, and the kind was not specified. Use
crate::repository::MediaRepository::get_by_external_id_and_kind with an explicit kind.
Fields
Sync(String)
A mutex was poisoned (internal synchronization error).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§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.