jellyfin_sdk_rust/
jellyfin_sdk_error.rs

1use thiserror::Error;
2
3/// Custom Result type to handle SDK errors.
4pub type JellyfinSDKResult<T> = std::result::Result<T, JellyfinSDKError>;
5
6/// Enum representing all possible SDK errors.
7#[derive(Error, Debug)]
8pub enum JellyfinSDKError {
9    #[error(transparent)]
10    ReqwestError(#[from] reqwest::Error),
11    #[error(transparent)]
12    InvalidURL(#[from] url::ParseError),
13    #[error("Cannot get path segments...")]
14    CannotGetPathSegments,
15    #[error("No Jellyfin instance has been created before calling `get_api()` method...")]
16    NoJellyfinAPICreated,
17    #[error("Received status code - {0}")]
18    HttpResponseError(u16),
19}