from requests.exceptions import HTTPError


class BaseException(Exception):
    pass


class APIError(BaseException, HTTPError):
    """
    The API responded with a non-200 status code.
    """

    def __init__(self, http_error):
        self.message = getattr(http_error, 'message', None)
        self.response = getattr(http_error, 'response', None)

    def __str__(self):
        return self.message or '<unknown error code>'


class InvalidCategoryException(BaseException):
    """
    The requested category was not found, or is unavailable for the given date.
    """
    pass

@@ -346,16 +346,87 @@
 ', None)
+%0A        self.status_code = getattr(self.response, 'status_code', None)
 %0A%0A    de

Add the 'status_code' attribute to the APIError exception if it's available