ibm_watson/auth/
errors.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4/// Errors that may be returned in creating an IAM access token for a user or service ID using an API key
5pub enum AuthenticationError {
6    #[error("Parameter validation failed. Required parameters are missing or parameter values are invalid.")]
7    /// Parameter validation failed. Response if required parameters are missing or if parameter values are invalid.
8    ParameterValidationFailed,
9    #[error("The incoming request did not contain a valid authentication information")]
10    /// The incoming request did not contain a valid authentication information.
11    InvalidAPIKey,
12    #[error(
13        "The incoming request is valid but the user is not allowed to perform the requested action."
14    )]
15    /// The incoming request is valid but the user is not allowed to perform the requested action.
16    NotAllowed,
17    #[error("Internal Server error. Response if unexpected error situation happened.")]
18    /// Internal Server error. Response if unexpected error situation happened.
19    ServerError,
20    #[error("{0}")]
21    /// Network Error
22    ConnectionError(String),
23}