-
Notifications
You must be signed in to change notification settings - Fork 291
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
Implement structured errors for all user facing errors #858
Conversation
036b6c2
to
3c4dac9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the most part, no major issues. I had some organizational questions, too, though.
"github.com/authzed/spicedb/pkg/schemadsl/compiler" | ||
) | ||
|
||
func rewriteError(ctx context.Context, err error) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If everything implements the proper interface for producing metadata, I wonder if it's better to be explicit at the call-sites as to how we're converting. That way we can distinguish when two different calls can return the same error, but have different desired responses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rewriteError
is per package, so it shouldn't need to be differentiated (yet anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only issue I see with this approach is it'll cause developers to just thoughtlessly do rewriteError(ctx, err)
and not think about what actually needs to happen. We've been doing it up until now, so I think it's fine, but I definitely think this pattern promotes a lack of thought for properly handling errors.
a4dbe2d
to
e1b1a1d
Compare
Updated |
e1b1a1d
to
24ea566
Compare
24ea566
to
0afe84c
Compare
Fixes #816