Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RemoteError(Exception):
- """Base exception for errors while getting data from remote locations"""
- def __init__(self, service_name, account_username, summary,
- requested_resource):
- super(SyncError, self).__init__()
- self.service_name = service_name
- self.account_username = account_username
- self.requested_resource = requested_resource
- self.summary = summary
- self.when = datetime.datetime.now()
- class RemoteServiceError(RemoteError):
- """Getting the ``requested_resource`` from the remote service
- ``service_name`` related to account ``account_username`` failed due to
- a service error as explained in ``summary``.
- """
- class RemoteServiceUnavailableError(RemoteServiceError):
- """Remote Service is not responsive right now"""
- class RemoteServiceBannedUsError(RemoteServiceError):
- """Remote service is not responding to our specific request due to us not
- following the services rules (i.e. when we exceed the request rate limit)"""
- class RemoteAccountError(RemoteError):
- """Getting the ``requested_resource`` from the remote service
- ``service_name`` related to account ``account_username`` failed due to
- an account error as explained in ``summary``.
- """
- class RemoteAccountDoesNotExistError(RemoteAccountError):
- """The requested account does not exist on the remote service"""
- class RemoteAccountIsNotPublicError(RemoteAccountError):
- """The requested account resources are not public"""
Add Comment
Please, Sign In to add comment