Guest User

Untitled

a guest
Feb 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. class RemoteError(Exception):
  2. """Base exception for errors while getting data from remote locations"""
  3.  
  4. def __init__(self, service_name, account_username, summary,
  5. requested_resource):
  6. super(SyncError, self).__init__()
  7. self.service_name = service_name
  8. self.account_username = account_username
  9. self.requested_resource = requested_resource
  10. self.summary = summary
  11. self.when = datetime.datetime.now()
  12.  
  13.  
  14. class RemoteServiceError(RemoteError):
  15. """Getting the ``requested_resource`` from the remote service
  16. ``service_name`` related to account ``account_username`` failed due to
  17. a service error as explained in ``summary``.
  18. """
  19.  
  20.  
  21. class RemoteServiceUnavailableError(RemoteServiceError):
  22. """Remote Service is not responsive right now"""
  23.  
  24.  
  25. class RemoteServiceBannedUsError(RemoteServiceError):
  26. """Remote service is not responding to our specific request due to us not
  27. following the services rules (i.e. when we exceed the request rate limit)"""
  28.  
  29.  
  30. class RemoteAccountError(RemoteError):
  31. """Getting the ``requested_resource`` from the remote service
  32. ``service_name`` related to account ``account_username`` failed due to
  33. an account error as explained in ``summary``.
  34. """
  35.  
  36.  
  37. class RemoteAccountDoesNotExistError(RemoteAccountError):
  38. """The requested account does not exist on the remote service"""
  39.  
  40.  
  41. class RemoteAccountIsNotPublicError(RemoteAccountError):
  42. """The requested account resources are not public"""
Add Comment
Please, Sign In to add comment