//! The type that represents all erros in `sfr-slack-api`.

use crate::error::BoxError;

/// The type that represents all erros in `sfr-slack-api`.
#[derive(thiserror::Error, Debug)]
pub enum ApiError {
    /// The error while requesting by HTTP.
    #[error("failed requesting `{0}`: {1}")]
    FailedToRequestByHttp(&'static str, BoxError),

    /// The error while reading JSON data.
    #[error("failed to read JSON in `{0}`: {1}")]
    FailedToReadJson(&'static str, BoxError),

    /// The error while reading the file in `files.upload`.
    #[error("failed to read file: {0}")]
    FailedToReadFileInFilesUpload(BoxError),

    /// The error while reading stream.
    #[error("failed to read strem in `{0}`: {1}")]
    FailedToReadStream(&'static str, BoxError),

    /// The error while creating the multipart form data.
    #[error("failed creating multipart form data: {0}")]
    FailedCreatingMulipartData(BoxError),
}
