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

Remove Error::Generic variants in favor of more specific errors #1083

Open
insipx opened this issue Sep 21, 2024 · 1 comment
Open

Remove Error::Generic variants in favor of more specific errors #1083

insipx opened this issue Sep 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@insipx
Copy link
Contributor

insipx commented Sep 21, 2024

Generic should not be used, instead we should prefer creating a new enum variant in almost all cases. Using "Generic" errors may lead to depending on strings in an a variant leading to difficult to find bugs.

If a string changes in one part of a codebase, it could inadvertently lead to very bad things happening if the author is not careful (silenced errors no longer becoming silenced, retryable errors no longer being retried, etc.).

Enum variants will give a compile time error and force the author to fix.

re: this comment:

// TODO: Figure out the full list of non-retryable errors.

@neekolas
Copy link
Contributor

❤️

@insipx insipx added the enhancement New feature or request label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants