Skip to content

Comments

raise InvalidApiKey if authorization fails#50

Open
skewballfox wants to merge 1 commit intothetvdb:mainfrom
skewballfox:exceptional
Open

raise InvalidApiKey if authorization fails#50
skewballfox wants to merge 1 commit intothetvdb:mainfrom
skewballfox:exceptional

Conversation

@skewballfox
Copy link

Right now, Auth catches HTTPError and throws a general exception, Which puts more effort on client side code to handle this specific case: Instead of catching specific errors, they need to catch all and parse it as a string to handle cases.

What this change does is if the status code is 401 (Unauthorized) it throws an InvalidAPIKey exception, otherwise it just throws the original HTTPError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant