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

Proposal: Define Error Variables #31

Open
uji opened this issue Dec 27, 2022 · 0 comments
Open

Proposal: Define Error Variables #31

uji opened this issue Dec 27, 2022 · 0 comments

Comments

@uji
Copy link

uji commented Dec 27, 2022

I’d like to allow library users to distinguish user caused errors and library or rpc caused errors.
This allows for better error handling by the user.

For example, in go-sql-driver/mysql, errors are defined by variables.
https://github.com/go-sql-driver/mysql/blob/ad9fa14acdcf7d0533e7fbe58728f3d216213ade/errors.go#L18-L31

In addition, complex ones are expressed by defining dedicated types.
https://github.com/go-sql-driver/mysql/blob/ad9fa14acdcf7d0533e7fbe58728f3d216213ade/errors.go#L57-L62

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