diff --git a/journyio/utils.py b/journyio/utils.py index e099482..626326d 100644 --- a/journyio/utils.py +++ b/journyio/utils.py @@ -9,6 +9,8 @@ class APIError(Enum): TooManyRequests = 4, "TooManyRequests" NotFoundError = 5, "NotFoundError" UnknownError = 6, "UnknownError" + ForbiddenError = 7, "ForbiddenError" + UnprocessableError = 8, "Unprocessable" class JournyException(Exception): @@ -24,10 +26,12 @@ def __str__(self): status_code_to_api_error_mapping = defaultdict(lambda: APIError.UnknownError) -status_code_to_api_error_mapping.update({401: APIError.UnauthorizedError, - 400: APIError.BadArgumentsError, - 429: APIError.TooManyRequests, +status_code_to_api_error_mapping.update({400: APIError.BadArgumentsError, + 401: APIError.UnauthorizedError, + 403: APIError.ForbiddenError, 404: APIError.NotFoundError, + 422: APIError.UnprocessableError, + 429: APIError.TooManyRequests, 500: APIError.ServerError})