-
-
Notifications
You must be signed in to change notification settings - Fork 556
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
make a pass at the changes for implementing issue-781 integrating pkg/errors #792
Conversation
Thank you the PR looks great! I was thinking we would let the user call |
@raphael Thanks for feedback. I will look at updating based on your comment |
@raphael Made the changes that I think address your comment. I added a test based on the other error_handler tests and on some of the logging tests. I am not particularly familiar with the test framework so not sure I have implemented the test as would be expected. Happy for any feedback |
@@ -38,7 +40,7 @@ func ErrorHandler(service *goa.Service, verbose bool) goa.Middleware { | |||
reqID = shortID() | |||
ctx = context.WithValue(ctx, reqIDKey, reqID) | |||
} | |||
goa.LogError(ctx, "uncaught error", "id", reqID, "msg", respBody) | |||
goa.LogError(ctx, fmt.Sprintf("uncaught error : %+v", e), "id", reqID, "msg", respBody) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Thank you! the changes look good. I left one comment related to how the logging of uncaught error is done but other than that LGTM. |
@raphael do you normally squash commits before merging or are these separate commits ok? |
Yes I'll squash the commits. Is this ready for merge? |
👍 |
Thank you! do you think you could create a PR against the |
@raphael absolutely happy to |
@raphael This is a pass at the changes I proposed for issue-781 #781
One concern I have here is backwards compatibility. If users are relying on type checks for errors they will stop working.
For example if they were relying on checks like
From a usability point of view there is no difference however. A user of goa can still do something like
and it will work as expected except now you will see a trace in the logs