-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add TraceCaller interface for extensibility for #104 #106
Conversation
Signed-off-by: Steve Coffman <steve@khanacademy.org>
9bc78a4
to
da1e9e9
Compare
Signed-off-by: Steve Coffman <steve@khanacademy.org>
Thanks, @StevenACoffman. This generally looks good, but I'd like to request a couple changes:
|
Signed-off-by: Steve Coffman <steve@khanacademy.org>
22ac828
to
bd1be4a
Compare
Sounds good! All done. |
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.
Thanks for the contribution @StevenACoffman
Signed-off-by: Steve Coffman <steve@khanacademy.org>
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.
LGTM minus one comment.
Thanks, @StevenACoffman.
CC @prashantv
@@ -20,14 +20,14 @@ func UnwrapFrame(err error) (frame runtime.Frame, inner error, ok bool) { //noli | |||
return runtime.Frame{}, err, false | |||
} | |||
|
|||
wrapErr := errors.Unwrap(err) | |||
inner = errors.Unwrap(err) |
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.
I agree that inner is a better name. wrapErr
was a silly play on wrapper
, but I still get to giggle when any error name's last syllable can be pronounced err
. 😄
![]() unclear what's going on with coverage. Patch coverage is 100%. @prashantv will merge later today; will give you a chance to look over first. |
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.
LGTM
Fixes #104
This PR extends errtrace functionality to accommodate custom errors that honor the new TraceCaller interface contract.
For instance, a custom error can have arbitrary fields as described in #36 and as long as it also contains a
TraceCall()
receiver function, it can be included in the errtrace.