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

Custom errors galore #130

Open
CptPie opened this issue Feb 26, 2022 · 1 comment
Open

Custom errors galore #130

CptPie opened this issue Feb 26, 2022 · 1 comment
Labels
enhancement New feature or request rework A existing feature that requires an rework.

Comments

@CptPie
Copy link
Collaborator

CptPie commented Feb 26, 2022

Time to add custom errors for ALL returned errors.

You might be wondering why?
Easy! to have a consistent codebase, either have it everywhere or nowhere!

Thx to @zorchenhimer :P

Have fun with the PR - it wont be pretty.

@CptPie CptPie added enhancement New feature or request rework A existing feature that requires an rework. labels Feb 26, 2022
@CptPie
Copy link
Collaborator Author

CptPie commented Mar 6, 2022

23:55 CptPie1: btw for the custom errors in moviepolls i had an interesting idea - having extra fields in the custom errors such that the error has the usual "message" as well as a "user friendly message"
23:56 CptPie1: where "message" would contain debug info while "user friendly message" contains user presentable feedback ("contact the admin because he fked up")
23:57 edorfaus: that makes a lot of sense to me CptPie1
23:58 edorfaus: then the top-level response handler could just look for the user-friendly-error interface to decide whether to respond with a generic message, or something from the error itself
23:58 CptPie1: smth else i just thought about, a "global" error counter, the usecase being to include that counter in both messages and as such the user can report the issue (with the error number [which is unique and incrementing]) to the admin and he could just search the logs for the respective log entry
23:58 edorfaus: and the rest of the code doesn't have to choose between useful-for-admin info and useful-for-user info
0:00 edorfaus: oh yeah, we've done that at work CptPie1 (though using random UUIDs instead of an auto-increment, to avoid needing central coordination of generation (including locks etc))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rework A existing feature that requires an rework.
Projects
None yet
Development

No branches or pull requests

1 participant