ibm_watson/text-to-speech/voices/
errors.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4/// Errors that may be returned when listing [`Watson Voices`]
5///
6/// [`Watson Voices`]: crate::tts::voices::WatsonVoice
7pub enum ListVoicesError {
8    #[error("The request specified an Accept header with an incompatible content type.")]
9    /// The request specified an Accept header with an incompatible content type
10    NotAcceptable406, //406
11    #[error("The request specified an unacceptable media type.")]
12    /// The request specified an unacceptable media type
13    UnsupportedMediaType415, // 415
14    #[error("The service experienced an internal error.")]
15    /// The service experienced an internal error
16    InternalServerError500, // 500
17    #[error("The service is currently unavailable.")]
18    /// The service is currently unavailable
19    ServiceUnavailable503, // 503
20    #[error("{0}")]
21    /// There was an error making the request
22    ConnectionError(String),
23}
24
25#[derive(Error, Debug)]
26/// Errors that may be returned when getting information about a particular [`WatsonVoice`]
27///
28/// [`WatsonVoice`]: crate::tts::voices::WatsonVoice
29pub enum GetVoiceError {
30    #[error("The requested resource has not been modified since the time specified by the If-Modified-Since header, as documented in the HTTP specification")]
31    /// The requested resource has not been modified since the time specified by the If-Modified-Since header, as documented in the HTTP specification
32    NotModified304,
33    #[error("A required input parameter is null or a specified input parameter or header value is invalid or not supported. Please check your customisation id")]
34    /// A required input parameter is null or a specified input parameter or header value is invalid or not supported. Please check your customisation id
35    BadRequest400,
36    #[error("The specified customisation_id {0} is invalid for the requesting credentials")]
37    /// The specified customisation_id is invalid for the requesting credentials
38    Unauthorised401(String),
39    #[error("The request specified an Accept header with an incompatible content type.")]
40    /// The request specified an Accept header with an incompatible content type
41    NotAcceptable406,
42    #[error("The request specified an unacceptable media type.")]
43    /// The request specified an unacceptable media type
44    UnsupportedMediaType415,
45    #[error("The service experienced an internal error.")]
46    /// The service experienced an internal error
47    InternalServerError500,
48    #[error("The service is currently unavailable.")]
49    /// The service is currently unavailable
50    ServiceUnavailable503,
51    #[error("{0}")]
52    /// There was an error making the request
53    ConnectionError(String),
54}