# -*- coding: utf-8 -*-
[docs]class ResourceUnavailable(Exception):
"""Exception representing a failed request to a resource"""
def __init__(self, msg, http_response):
Exception.__init__(self)
self._msg = msg
self._status = http_response.status_code
def __str__(self):
return "%s (HTTP status: %s)" % (self._msg, self._status)
[docs]class Unauthorized(ResourceUnavailable):
pass
[docs]class TokenError(Exception):
pass