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

Idiomatic error handling for requests #18

Open
orblivion opened this issue Aug 25, 2022 · 0 comments
Open

Idiomatic error handling for requests #18

orblivion opened this issue Aug 25, 2022 · 0 comments

Comments

@orblivion
Copy link
Collaborator

Right now I have a weird thing where I have a function that checks for auth errors, and replies to the request with a json error and otherwise returns a token. I probably want to return an error, but I didn't want to have a lot of boilerplate in the handler.

I could probably create a new error type that automatically becomes a json. And a different variant for 500s, since the error should not be output to the user, but rather logs instead (as I do now but in a less idiomatic way).

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