Skip to content
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

integrate error codes with pkg/errors to provide error tracing #1200

Merged
merged 26 commits into from
Sep 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bc61230
add pkg/errors to Gopkg
gregwebs Aug 16, 2018
7a5bbab
integrate with pkg/errors
gregwebs Aug 15, 2018
4b604c5
Merge remote-tracking branch 'main/master' into gregwebs/error-code-t…
gregwebs Aug 24, 2018
8a0ced9
fix comment spellings
gregwebs Aug 27, 2018
c3c9a11
search for the deepest available stack trace
gregwebs Aug 27, 2018
c4a46a3
re-use the existing StackTrace function
gregwebs Aug 28, 2018
3c88460
only internal errors should show a stack trace
gregwebs Aug 28, 2018
48e18df
Merge remote-tracking branch 'main/master' into gregwebs/error-code-t…
gregwebs Aug 28, 2018
acb0499
update documentation
gregwebs Aug 28, 2018
4314b76
Merge branch 'master' into gregwebs/error-code-tracing
gregwebs Sep 6, 2018
35dc1b0
Upgrade pkg/errors to latest pingcap/errors
gregwebs Sep 8, 2018
a4d546f
use stack code in pingcap/errors
gregwebs Sep 8, 2018
70edcec
Merge branch 'master' into gregwebs/error-code-tracing
gregwebs Sep 8, 2018
ee73eb5
use errors.Unwrap
gregwebs Sep 8, 2018
b79940d
error grouping
gregwebs Aug 15, 2018
b026410
upgrade pingcap/errors
gregwebs Sep 11, 2018
ff5c090
use the latest from pingcap/errors
gregwebs Sep 11, 2018
4d88fdf
Merge remote-tracking branch 'main/master' into gregwebs/error-code-t…
gregwebs Sep 11, 2018
99af76d
bugfix
gregwebs Sep 11, 2018
dee08a8
update to latest pingcap/errors (docs update)
gregwebs Sep 21, 2018
84a95c4
Merge remote-tracking branch 'main/master' into gregwebs/error-code-t…
gregwebs Sep 21, 2018
71fd836
Merge remote-tracking branch 'main/master' into gregwebs/error-code-t…
gregwebs Sep 25, 2018
64bcff4
vendor: errcode is now its own package
gregwebs Sep 25, 2018
8fcb0b4
switch to separate package for errcode
gregwebs Sep 25, 2018
55f3967
fix gofmt
gregwebs Sep 26, 2018
6ef458d
Merge branch 'master' into gregwebs/error-code-tracing
gregwebs Sep 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
name = "github.com/pkg/errors"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seem we have already used juju errors, conflicted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the conflict? Both packages work together fine by using the same Causer interface. The rest of the API is the same, but with slightly different names (but pkg/errors can record a stack trace). See:

I am happy to send a PR to make the switch in PD when we are ready.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gregwebs

I suggest only using one errors, so it is better to remove juju at first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I can send a PR for that. Would you like to continue to review this PR in the mean time since that PR won't affect this one (other than both adding pkg/errors in Gopkg)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course, we can go on

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1210 is merged: we are now using pkg/errors

version = ">= 0.8.0"

[[constraint]]
name = "github.com/pingcap/errcode"
version = ">= 0.1.0"

[[override]]
name = "github.com/BurntSushi/toml"
revision = "3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005"
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ Consider that raml2html depends on various npm packages and can only be run unde

## Error responses

Error responses from the server are switching to using [error codes](../pkg/error_code/error_code.go).
Error responses from the server are switching to using [errcode codes](https://github.com/pingcap/errcode).
The should use the `errorResp` function. Please look at other places in the codebase that use `errorResp`.
345 changes: 0 additions & 345 deletions pkg/error_code/error_code_test.go

This file was deleted.

Loading