Updates aws/aws-xray-sdk-go#77
Updates evalphobia/logrus_sentry#74
Go 1.12 has updated the behaviour of runtime.FuncForPC so that it
behaves as it did in Go 1.11 and earlier.
This allows errors.Frame to return to a uintptr representing the PC +1
of the caller. This will fix the build breakages of projects that were
tracking HEAD of this package.
Signed-off-by: Dave Cheney <dave@cheney.net>
Introduces WithMessage as well as errors.fundamental, errors.withMessage
and errors.withStack internal types.
Adjust tests for the new wrapped format when combining fundamental and
wrapped errors.
* Extended stacktrace output
* Make format tests less sensitive to sourcecode prefix
* use testFormatRegexp for all Sprintf tests
* replace output test with sample output
* work around the different fn.Name format in go 1.4
* fix windows tests when there is a drive letter in the source path
* Introduce errors.Stacktrace
Introduce a new type to replace the unnamed return value from
`Stacktrace()`. `Stacktrace` implements `fmt.Formatter` and currently
replicates the default behaviour of printing a `[]Frame`.
In a future PR the values of `%+v` and `%#v` will be extended to
implement a more readable stacktrace.
* Introduce Stacktrace and Frame
This PR is a continuation of a series aimed at exposing the stack trace
information embedded in each error value. The secondary effect is to
deprecated the `Fprintf` helper.
Taking cues from from @chrishines' `stack` package this PR introduces a
new interface `Stacktrace() []Frame` and a `Frame` type, similar in
function to the `runtime.Frame` type (although lacking its iterator
type). Each `Frame` implemnts `fmt.Formatter` allowing it to print
itself.
The older `Location` interface is still supported but also deprecated.