Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent response return for login() #46

Open
UlrikHD opened this issue Sep 11, 2024 · 0 comments
Open

Inconsistent response return for login() #46

UlrikHD opened this issue Sep 11, 2024 · 0 comments

Comments

@UlrikHD
Copy link
Contributor

UlrikHD commented Sep 11, 2024

Currently LemmyHttp.login() is the only function that checks for status code before returning a response object, raising a generic Exception if status code isn't 200. To keep functions consistent across all LemmyHttp functions, I would suggest either removing the status code check and just return the response object (preferably) or raising a more precise exception than the base Exception class.

The problem with the current implementation is that if we get an Exception during login, we can't check the response for more granular error handling, e.g. if login is denied or server is down.

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

No branches or pull requests

1 participant