"""
The following exceptions may be raised during the course of using
:py:class:`tornado_aws.client.AWSClient` and
:py:class:`tornado_aws.client.AsyncAWSClient`:
"""
[docs]class AWSClientException(Exception):
"""Base exception class for AWSClient
:ivar msg: The error message
"""
fmt = 'An error occurred'
def __init__(self, **kwargs):
super(AWSClientException, self).__init__(self.fmt.format(**kwargs),
kwargs)
[docs]class CurlNotInstalledError(Exception):
"""Raised when the CurlAsyncHTTPClient is requested but pycurl is not
installed.
"""
fmt = 'use_curl was specified but pycurl is not installed'
[docs]class AWSError(AWSClientException):
"""Raised when the credentials could not be located."""
fmt = '{message}'
[docs]class ConfigNotFound(AWSClientException):
"""The configuration file could not be parsed.
:ivar path: The path to the config file
"""
fmt = 'The config file could not be found ({path})'
[docs]class ConfigParserError(AWSClientException):
"""Error raised when parsing a configuration file with
:py:class`configparser.RawConfigParser`
:ivar path: The path to the config file
"""
fmt = 'Unable to parse config file ({path})'
[docs]class LocalCredentialsError(AWSClientException):
"""Raised when the credentials could not be located."""
fmt = 'Cant reset local credentials'
[docs]class NoCredentialsError(AWSClientException):
"""Raised when the credentials could not be located."""
fmt = 'Credentials not found'
[docs]class NoProfileError(AWSClientException):
"""Raised when the specified profile could not be located.
:ivar path: The path to the config file
:ivar profile: The profile that was specified
"""
fmt = 'Profile ({profile}) not found ({path})'
[docs]class RequestException(AWSClientException):
"""Raised when a request failed due to a network issue.
:ivar error: The error which occured
"""
fmt = 'An error occured making a request {error}'