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>
With Go 1.12, we will now be doing mid-stack inlining. This exposes
inlined frames to runtime.Callers and friends.
The spec says that a runtime.Frame may have a nil Func field for
inlined functions. Instead, use the Function field to detect whether
we really have an empty Frame.
Adds testFormatCompleteCompare as additional testing func.
The new function takes a string slice as "want", wherein
stacktraces and non-stacktrace messages are discerned by
strings.ContainsAny(want[i], "\n").
For example usage, see TestFormatWithStack & TestFormatWithMessage.
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
* Use fmt.Formatter throughout
Replace Fprintf with fmt.Formatter logic on various types. This
effectively guts Fprint to be just a recursive call down the err.Cause
chain. The next step will be to move this recursive logic into
wrapper.Format.
This change necessitates adding types for the error impls returned from
New and Errorf, and Wrap and Wrapf, respectively. The name of the latter
type is acceptable, the former is not and alternative suggestions are
encouraged.
- Remove cause.Format
- Added fmt.Formatter tests. The location is temporary, once this PR is merged and Fprint removed
they will be merged into errors_test.go