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

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4/// Errors that may be returned in speech synethesis
5pub enum SynthesisError {
6    #[error("A required input parameter is null or a specified input parameter or header value is invalid")]
7    ///  A required input parameter is null or a specified input parameter or header value is invalid. For example, prompt_id '{prompt_id}' not found in custom model '{customisation_id}' if you attempt to use a nonexistent or deleted custom prompt
8    BadRequest400,
9    #[error("The specified voice does not exist")]
10    /// The specified voice does not exist or, for IBM Cloud Pak for Data, the voice parameter was not specified but the default voice is not installed. The message is Model '{voice}' not found
11    NotFound404,
12    #[error("The request specified an incompatible content type or failed to specify a required sampling rate")]
13    /// The request specified an incompatible content type or failed to specify a required sampling rate
14    NotAcceptable406,
15    #[error("The request specified an unacceptable media type.")]
16    /// The request specified an unacceptable media type
17    UnsupportedMediaType415,
18    #[error("The service experienced an internal error.")]
19    /// The service experienced an internal error
20    InternalServerError500,
21    #[error("The service is currently unavailable.")]
22    /// The service is currently unavailable
23    ServiceUnavailable500,
24    #[error("Connection error: {0}")]
25    /// Some other error occurred in the request
26    ConnectionError(String),
27}