psn_rs 0.1.0

Interact with PlayStation Network API in full Rust!
Documentation
use thiserror::Error;

/// PSN API result type.
pub type PSNApiResult<T> = Result<T, PSNError>;

/// PSN API error type.
#[derive(Debug, Error)]
pub enum PSNError {
    /// No NPSSO token has been provided.
    #[error("no NPSSO token provided")]
    NoNPSSOTokenProvided,
    /// Error occured with http request.
    #[error(transparent)]
    ReqwestError(#[from] reqwest::Error),
    #[error(transparent)]
    /// Provided header has an invalid value.
    InvalidHeaderValue(#[from] reqwest::header::InvalidHeaderValue),
    /// Cannot parse given URL
    #[error("failed to parse URL: {0}")]
    UrlParseError(#[from] url::ParseError),
    /// Generic error with a message.
    #[error("generic error:{0}")]
    GenericError(String),
}