-
Notifications
You must be signed in to change notification settings - Fork 16
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
Context based error reporting #37
Closed
seanhagen
wants to merge
19
commits into
honeybadger-io:master
from
seanhagen:context-based-reporting
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2d3ce7b
Add key for storing values in context.Context
seanhagen 4469ff6
Add error for when casting fails
seanhagen 701467c
Update `Client.SetContext` to require `context.Context`
seanhagen 2b9ad5e
Update `Client.Notify` to require `context.Context`
seanhagen 0eee8d0
Update Monitor to require `context.Context`
seanhagen b4e01f1
No more need for `Client.context`, so removing it
seanhagen 6f6033d
Update `Client.Handler` to use `r.Context()`
seanhagen bce4a85
Update functions to require `context.Context`
seanhagen e0ad81e
Use `context.Background` in `Monitor()`
seanhagen d22f292
Update godoc comment
seanhagen e178ad8
Add import
seanhagen 7893ff7
Update tests so they pass
seanhagen 76e8aa8
Version bump -- v0.5.0
seanhagen 9303263
Update tests
seanhagen 5dd20b6
Remove `spew.Dump` from tests
seanhagen cba695c
Update readme to reflect changes
seanhagen da91803
Add information to honeybadger context before calling handler
seanhagen 3fc78e0
Fix `SetContext` call
seanhagen ff8bb56
Go modules, use gofrs uuid library instead
seanhagen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module github.com/seanhagen/honeybadger-go | ||
|
||
require ( | ||
github.com/gofrs/uuid/v3 v3.1.2 | ||
github.com/shirou/gopsutil v2.18.12+incompatible | ||
golang.org/x/sys v0.0.0-20190102155601-82a175fd1598 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
github.com/gofrs/uuid/v3 v3.1.2 h1:V3IBv1oU82x6YIr5txe3azVHgmOKYdyKQTowm9moBlY= | ||
github.com/gofrs/uuid/v3 v3.1.2/go.mod h1:xPwMqoocQ1L5G6pXX5BcE7N5jlzn2o19oqAKxwZW/kI= | ||
github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAriGFsTZppLXDX93OM= | ||
github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= | ||
golang.org/x/sys v0.0.0-20190102155601-82a175fd1598 h1:S8GOgffXV1X3fpVG442QRfWOt0iFl79eHJ7OPt725bo= | ||
golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Adding this data is great, but we'll want to send it as
cgi_data
(with special keys) instead of context--that's what we use to display request data in error reports. For an example, search for "cgi_data" on this page: https://docs.honeybadger.io/api/exceptions.html#sample-payloadHere's how we construct it in Elixir, for instance: https://github.com/honeybadger-io/honeybadger-elixir/blob/94c6c1f29cef70ae754bf12aa99779849ddd0b70/lib/honeybadger/plug_data.ex#L49
I'd probably hold off on including this in the current PR (since it's kind of a separate feature) and then submit a subsequent PR after we get the new
ctx
API worked out.