-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Create an abstraction for Internal Errors vs Request Errors. #7192
Comments
We have the |
Yes, So, either we make a small update the errors package, or change the type. I think update should work, and here is an idea: We can add a new parameter to the
If we want to make this not-breaking change, then we can add it as an optional argument (variadic argument) of |
Some background for this issue: #7166 (comment) |
Are there examples in other libraries that do this? I've never seen this convention in Golang. Typically, the error message and/or error type name provide all the context. In addition, we already have code and codespace, so why not stick with those? |
Yes, this library will also work - we will just need to do small update to classify errors between internal and not internal. This can be done either by adding a new parameter to the The main motivation is to enable smart reporting / monitoring. Enterprises usually don't want to report request errors internally. But they want to report / monitor for internal errors, local net IO errors etc... |
reopen if this is still relevant. |
Summary
Most (if not all) errors created in the SDK don't have any semantic. This makes it hard (or even impossible) to define some logic for handling this kind of errors (example: sending them to some errors aggregator), printing, notifications.
Problem Definition
Explained above.
Proposal
Use a structures which implement the
Error
interface and are able to carry semantic information.One option is to use the errstack library. Disclaimer: I'm an author of it and use it in many enterprise projects.
For Admin Use
The text was updated successfully, but these errors were encountered: