From 7d46ef14fdc17b65ae46339d447e2756110a8016 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Fri, 4 Mar 2022 15:09:33 +0100 Subject: [PATCH] barriers: reveal more safe details about the masked error This commit extracts more safe details for the error hidden behind a barrier. It achieves this using the new `SafeFormatError()` API via the `redact` package. As a side effect, this guarantees that a sentry report for a barrier (including, but not limited to, assertion failures constructed with errors.NewAssertionErrorWithWrappedErrf) now always spells out the type of the error behind the barrier. It also includes any safe-for-reporting strings that the hidden error object would report when printed out via `%+v`. Note that this patch is a band-aid: this is really adding more complexity to the `SafeDetails()` API, which is arguably somewhat obsolete now that the `errors` and `redact` packages collaborate to extract safe strings. However, there is some marginal utility remaining, in the particular case of an error object transported over the wire where the target server doesn't know how to decode the error behind the barrier; in this case, the approach taken here ensures that a modicum of reportable structure is still included. --- barriers/barriers.go | 2 + fmttests/testdata/format/wrap-fmt | 46 +++++- fmttests/testdata/format/wrap-fmt-via-network | 46 +++++- fmttests/testdata/format/wrap-goerr | 34 ++++- .../testdata/format/wrap-goerr-via-network | 34 ++++- fmttests/testdata/format/wrap-newf | 120 ++++++++++++++++ .../testdata/format/wrap-newf-via-network | 132 ++++++++++++++++++ fmttests/testdata/format/wrap-nofmt | 34 ++++- .../testdata/format/wrap-nofmt-via-network | 46 +++++- fmttests/testdata/format/wrap-pkgerr | 116 +++++++++++++++ .../testdata/format/wrap-pkgerr-via-network | 132 ++++++++++++++++++ 11 files changed, 706 insertions(+), 36 deletions(-) diff --git a/barriers/barriers.go b/barriers/barriers.go index fa4f431..7e6d6f7 100644 --- a/barriers/barriers.go +++ b/barriers/barriers.go @@ -19,6 +19,7 @@ import ( "fmt" "github.com/cockroachdb/errors/errbase" + "github.com/cockroachdb/redact" "github.com/gogo/protobuf/proto" ) @@ -88,6 +89,7 @@ func (e *barrierError) SafeDetails() []string { sd := errbase.GetSafeDetails(err) details = sd.Fill(details) } + details = append(details, redact.Sprintf("masked error: %+v", e.maskedErr).Redact().StripMarkers()) return details } diff --git a/fmttests/testdata/format/wrap-fmt b/fmttests/testdata/format/wrap-fmt index 1cbf76a..9087e75 100644 --- a/fmttests/testdata/format/wrap-fmt +++ b/fmttests/testdata/format/wrap-fmt @@ -137,9 +137,18 @@ Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *barr :: × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) :: *withstack.withStack (top exception) *assert.withAssertionFailure +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) ×× + × + × + × + × + Error types: (1) *fmttests.errFmt == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -324,12 +333,20 @@ Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *erru ×: × × -- -*barriers.barrierError -*errutil.withPrefix: assertmsg: × (1) +*barriers.barrierError: masked error: × (1) +*errutil.withPrefix: assertmsg: × (2) :: *withstack.withStack (top exception) *assert.withAssertionFailure (check the extra data payloads) == Extra "1: details" +masked error: × + (1) ×× + × + × + × + × + Error types: (1) *fmttests.errFmt +== Extra "2: details" assertmsg: × × == Extra "error types" @@ -440,7 +457,16 @@ Error types: (1) *barriers.barrierError × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) ×× + × + × + × + × + Error types: (1) *fmttests.errFmt == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -1528,10 +1554,18 @@ Error types: (1) *domains.withDomain (2) *barriers.barrierError × × -- -*barriers.barrierError -*domains.withDomain: error domain: pkg (1) +*barriers.barrierError: masked error: × (1) +*domains.withDomain: error domain: pkg (2) (check the extra data payloads) == Extra "1: details" +masked error: × + (1) ×× + × + × + × + × + Error types: (1) *fmttests.errFmt +== Extra "2: details" error domain: pkg == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) diff --git a/fmttests/testdata/format/wrap-fmt-via-network b/fmttests/testdata/format/wrap-fmt-via-network index d83d3cc..8d06ce4 100644 --- a/fmttests/testdata/format/wrap-fmt-via-network +++ b/fmttests/testdata/format/wrap-fmt-via-network @@ -172,9 +172,18 @@ Error types: (1) *assert.withAssertionFailure (2) *errbase.opaqueWrapper (3) *ba :: × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) :: *withstack.withStack (top exception) *assert.withAssertionFailure +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/cockroachdb/errors/fmttests/*fmttests.errFmt + Error types: (1) *errbase.opaqueLeaf == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -394,12 +403,20 @@ Error types: (1) *assert.withAssertionFailure (2) *errbase.opaqueWrapper (3) *er ×: × × -- -*barriers.barrierError -*errutil.withPrefix: assertmsg: × (1) +*barriers.barrierError: masked error: × (1) +*errutil.withPrefix: assertmsg: × (2) :: *withstack.withStack (top exception) *assert.withAssertionFailure (check the extra data payloads) == Extra "1: details" +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/cockroachdb/errors/fmttests/*fmttests.errFmt + Error types: (1) *errbase.opaqueLeaf +== Extra "2: details" assertmsg: × × == Extra "error types" @@ -527,7 +544,16 @@ Error types: (1) *barriers.barrierError × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/cockroachdb/errors/fmttests/*fmttests.errFmt + Error types: (1) *errbase.opaqueLeaf == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -1965,10 +1991,18 @@ Error types: (1) *domains.withDomain (2) *barriers.barrierError × × -- -*barriers.barrierError -*domains.withDomain: error domain: pkg (1) +*barriers.barrierError: masked error: × (1) +*domains.withDomain: error domain: pkg (2) (check the extra data payloads) == Extra "1: details" +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/cockroachdb/errors/fmttests/*fmttests.errFmt + Error types: (1) *errbase.opaqueLeaf +== Extra "2: details" error domain: pkg == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) diff --git a/fmttests/testdata/format/wrap-goerr b/fmttests/testdata/format/wrap-goerr index c0d3dce..d0fbf14 100644 --- a/fmttests/testdata/format/wrap-goerr +++ b/fmttests/testdata/format/wrap-goerr @@ -131,9 +131,15 @@ Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *barr :: × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) :: *withstack.withStack (top exception) *assert.withAssertionFailure +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *errors.errorString == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -312,12 +318,17 @@ Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *erru ×: × × -- -*barriers.barrierError -*errutil.withPrefix: assertmsg: × (1) +*barriers.barrierError: masked error: × (1) +*errutil.withPrefix: assertmsg: × (2) :: *withstack.withStack (top exception) *assert.withAssertionFailure (check the extra data payloads) == Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *errors.errorString +== Extra "2: details" assertmsg: × × == Extra "error types" @@ -422,7 +433,13 @@ Error types: (1) *barriers.barrierError × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *errors.errorString == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -1422,10 +1439,15 @@ Error types: (1) *domains.withDomain (2) *barriers.barrierError × × -- -*barriers.barrierError -*domains.withDomain: error domain: pkg (1) +*barriers.barrierError: masked error: × (1) +*domains.withDomain: error domain: pkg (2) (check the extra data payloads) == Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *errors.errorString +== Extra "2: details" error domain: pkg == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) diff --git a/fmttests/testdata/format/wrap-goerr-via-network b/fmttests/testdata/format/wrap-goerr-via-network index a276f06..3e2d234 100644 --- a/fmttests/testdata/format/wrap-goerr-via-network +++ b/fmttests/testdata/format/wrap-goerr-via-network @@ -150,9 +150,15 @@ Error types: (1) *assert.withAssertionFailure (2) *errbase.opaqueWrapper (3) *ba :: × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) :: *withstack.withStack (top exception) *assert.withAssertionFailure +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *errors.errorString == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -350,12 +356,17 @@ Error types: (1) *assert.withAssertionFailure (2) *errbase.opaqueWrapper (3) *er ×: × × -- -*barriers.barrierError -*errutil.withPrefix: assertmsg: × (1) +*barriers.barrierError: masked error: × (1) +*errutil.withPrefix: assertmsg: × (2) :: *withstack.withStack (top exception) *assert.withAssertionFailure (check the extra data payloads) == Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *errors.errorString +== Extra "2: details" assertmsg: × × == Extra "error types" @@ -461,7 +472,13 @@ Error types: (1) *barriers.barrierError × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *errors.errorString == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -1613,10 +1630,15 @@ Error types: (1) *domains.withDomain (2) *barriers.barrierError × × -- -*barriers.barrierError -*domains.withDomain: error domain: pkg (1) +*barriers.barrierError: masked error: × (1) +*domains.withDomain: error domain: pkg (2) (check the extra data payloads) == Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *errors.errorString +== Extra "2: details" error domain: pkg == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) diff --git a/fmttests/testdata/format/wrap-newf b/fmttests/testdata/format/wrap-newf index 05a86b2..8fc0553 100644 --- a/fmttests/testdata/format/wrap-newf +++ b/fmttests/testdata/format/wrap-newf @@ -224,6 +224,36 @@ details for github.com/cockroachdb/errors/withstack/*withstack.withStack::: details for github.com/cockroachdb/errors/errutil/*errutil.leafError::: new-style × × +masked error: new-style × + (1) attached stack trace + -- stack trace: + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Wraps: (2) new-style × + | × + Error types: (1) *withstack.withStack (2) *errutil.leafError == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -498,6 +528,36 @@ details for github.com/cockroachdb/errors/withstack/*withstack.withStack::: details for github.com/cockroachdb/errors/errutil/*errutil.leafError::: new-style × × +masked error: new-style × + (1) attached stack trace + -- stack trace: + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Wraps: (2) new-style × + | × + Error types: (1) *withstack.withStack (2) *errutil.leafError == Extra "2: details" assertmsg: × × @@ -696,6 +756,36 @@ details for github.com/cockroachdb/errors/withstack/*withstack.withStack::: details for github.com/cockroachdb/errors/errutil/*errutil.leafError::: new-style × × +masked error: new-style × + (1) attached stack trace + -- stack trace: + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Wraps: (2) new-style × + | × + Error types: (1) *withstack.withStack (2) *errutil.leafError == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -2888,6 +2978,36 @@ details for github.com/cockroachdb/errors/withstack/*withstack.withStack::: details for github.com/cockroachdb/errors/errutil/*errutil.leafError::: new-style × × +masked error: new-style × + (1) attached stack trace + -- stack trace: + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Wraps: (2) new-style × + | × + Error types: (1) *withstack.withStack (2) *errutil.leafError == Extra "2: details" error domain: pkg == Extra "error types" diff --git a/fmttests/testdata/format/wrap-newf-via-network b/fmttests/testdata/format/wrap-newf-via-network index f5d0c3d..ec50088 100644 --- a/fmttests/testdata/format/wrap-newf-via-network +++ b/fmttests/testdata/format/wrap-newf-via-network @@ -261,6 +261,39 @@ details for github.com/cockroachdb/errors/withstack/*withstack.withStack::: details for github.com/cockroachdb/errors/errutil/*errutil.leafError::: new-style × × +masked error: new-style × + (1) + | (opaque error wrapper) + | type name: github.com/cockroachdb/errors/withstack/*withstack.withStack + | reportable 0: + | + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Wraps: (2) new-style × + | × + Error types: (1) *errbase.opaqueWrapper (2) *errutil.leafError == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -572,6 +605,39 @@ details for github.com/cockroachdb/errors/withstack/*withstack.withStack::: details for github.com/cockroachdb/errors/errutil/*errutil.leafError::: new-style × × +masked error: new-style × + (1) + | (opaque error wrapper) + | type name: github.com/cockroachdb/errors/withstack/*withstack.withStack + | reportable 0: + | + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Wraps: (2) new-style × + | × + Error types: (1) *errbase.opaqueWrapper (2) *errutil.leafError == Extra "2: details" assertmsg: × × @@ -789,6 +855,39 @@ details for github.com/cockroachdb/errors/withstack/*withstack.withStack::: details for github.com/cockroachdb/errors/errutil/*errutil.leafError::: new-style × × +masked error: new-style × + (1) + | (opaque error wrapper) + | type name: github.com/cockroachdb/errors/withstack/*withstack.withStack + | reportable 0: + | + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Wraps: (2) new-style × + | × + Error types: (1) *errbase.opaqueWrapper (2) *errutil.leafError == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -3311,6 +3410,39 @@ details for github.com/cockroachdb/errors/withstack/*withstack.withStack::: details for github.com/cockroachdb/errors/errutil/*errutil.leafError::: new-style × × +masked error: new-style × + (1) + | (opaque error wrapper) + | type name: github.com/cockroachdb/errors/withstack/*withstack.withStack + | reportable 0: + | + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Wraps: (2) new-style × + | × + Error types: (1) *errbase.opaqueWrapper (2) *errutil.leafError == Extra "2: details" error domain: pkg == Extra "error types" diff --git a/fmttests/testdata/format/wrap-nofmt b/fmttests/testdata/format/wrap-nofmt index fa022bf..bef2774 100644 --- a/fmttests/testdata/format/wrap-nofmt +++ b/fmttests/testdata/format/wrap-nofmt @@ -131,9 +131,15 @@ Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *barr :: × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) :: *withstack.withStack (top exception) *assert.withAssertionFailure +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *fmttests.errNoFmt == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -312,12 +318,17 @@ Error types: (1) *assert.withAssertionFailure (2) *withstack.withStack (3) *erru ×: × × -- -*barriers.barrierError -*errutil.withPrefix: assertmsg: × (1) +*barriers.barrierError: masked error: × (1) +*errutil.withPrefix: assertmsg: × (2) :: *withstack.withStack (top exception) *assert.withAssertionFailure (check the extra data payloads) == Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *fmttests.errNoFmt +== Extra "2: details" assertmsg: × × == Extra "error types" @@ -422,7 +433,13 @@ Error types: (1) *barriers.barrierError × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *fmttests.errNoFmt == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -1422,10 +1439,15 @@ Error types: (1) *domains.withDomain (2) *barriers.barrierError × × -- -*barriers.barrierError -*domains.withDomain: error domain: pkg (1) +*barriers.barrierError: masked error: × (1) +*domains.withDomain: error domain: pkg (2) (check the extra data payloads) == Extra "1: details" +masked error: × + (1) ×× + × + Error types: (1) *fmttests.errNoFmt +== Extra "2: details" error domain: pkg == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) diff --git a/fmttests/testdata/format/wrap-nofmt-via-network b/fmttests/testdata/format/wrap-nofmt-via-network index 0500ec4..f097738 100644 --- a/fmttests/testdata/format/wrap-nofmt-via-network +++ b/fmttests/testdata/format/wrap-nofmt-via-network @@ -172,9 +172,18 @@ Error types: (1) *assert.withAssertionFailure (2) *errbase.opaqueWrapper (3) *ba :: × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) :: *withstack.withStack (top exception) *assert.withAssertionFailure +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/cockroachdb/errors/fmttests/*fmttests.errNoFmt + Error types: (1) *errbase.opaqueLeaf == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -394,12 +403,20 @@ Error types: (1) *assert.withAssertionFailure (2) *errbase.opaqueWrapper (3) *er ×: × × -- -*barriers.barrierError -*errutil.withPrefix: assertmsg: × (1) +*barriers.barrierError: masked error: × (1) +*errutil.withPrefix: assertmsg: × (2) :: *withstack.withStack (top exception) *assert.withAssertionFailure (check the extra data payloads) == Extra "1: details" +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/cockroachdb/errors/fmttests/*fmttests.errNoFmt + Error types: (1) *errbase.opaqueLeaf +== Extra "2: details" assertmsg: × × == Extra "error types" @@ -527,7 +544,16 @@ Error types: (1) *barriers.barrierError × × -- -*barriers.barrierError +*barriers.barrierError: masked error: × (1) +(check the extra data payloads) +== Extra "1: details" +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/cockroachdb/errors/fmttests/*fmttests.errNoFmt + Error types: (1) *errbase.opaqueLeaf == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -1965,10 +1991,18 @@ Error types: (1) *domains.withDomain (2) *barriers.barrierError × × -- -*barriers.barrierError -*domains.withDomain: error domain: pkg (1) +*barriers.barrierError: masked error: × (1) +*domains.withDomain: error domain: pkg (2) (check the extra data payloads) == Extra "1: details" +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/cockroachdb/errors/fmttests/*fmttests.errNoFmt + Error types: (1) *errbase.opaqueLeaf +== Extra "2: details" error domain: pkg == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) diff --git a/fmttests/testdata/format/wrap-pkgerr b/fmttests/testdata/format/wrap-pkgerr index 64838d4..b56b7d9 100644 --- a/fmttests/testdata/format/wrap-pkgerr +++ b/fmttests/testdata/format/wrap-pkgerr @@ -219,6 +219,35 @@ details for github.com/pkg/errors/*errors.fundamental::: : runtime.goexit : +masked error: × + (1) ×× + × + -- stack trace: + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Error types: (1) *errors.fundamental == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -488,6 +517,35 @@ details for github.com/pkg/errors/*errors.fundamental::: : runtime.goexit : +masked error: × + (1) ×× + × + -- stack trace: + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Error types: (1) *errors.fundamental == Extra "2: details" assertmsg: × × @@ -681,6 +739,35 @@ details for github.com/pkg/errors/*errors.fundamental::: : runtime.goexit : +masked error: × + (1) ×× + × + -- stack trace: + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Error types: (1) *errors.fundamental == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -2741,6 +2828,35 @@ details for github.com/pkg/errors/*errors.fundamental::: : runtime.goexit : +masked error: × + (1) ×× + × + -- stack trace: + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Error types: (1) *errors.fundamental == Extra "2: details" error domain: pkg == Extra "error types" diff --git a/fmttests/testdata/format/wrap-pkgerr-via-network b/fmttests/testdata/format/wrap-pkgerr-via-network index 94bfa39..cfc4ca7 100644 --- a/fmttests/testdata/format/wrap-pkgerr-via-network +++ b/fmttests/testdata/format/wrap-pkgerr-via-network @@ -256,6 +256,39 @@ details for github.com/pkg/errors/*errors.fundamental::: : runtime.goexit : +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/pkg/errors/*errors.fundamental + | reportable 0: + | + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Error types: (1) *errbase.opaqueLeaf == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) github.com/cockroachdb/errors/withstack/*withstack.withStack (*::) @@ -562,6 +595,39 @@ details for github.com/pkg/errors/*errors.fundamental::: : runtime.goexit : +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/pkg/errors/*errors.fundamental + | reportable 0: + | + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Error types: (1) *errbase.opaqueLeaf == Extra "2: details" assertmsg: × × @@ -774,6 +840,39 @@ details for github.com/pkg/errors/*errors.fundamental::: : runtime.goexit : +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/pkg/errors/*errors.fundamental + | reportable 0: + | + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Error types: (1) *errbase.opaqueLeaf == Extra "error types" github.com/cockroachdb/errors/barriers/*barriers.barrierError (*::) == Exception 1 (Module: "error domain: ") @@ -3196,6 +3295,39 @@ details for github.com/pkg/errors/*errors.fundamental::: : runtime.goexit : +masked error: × + (1) × + | × + | + | (opaque error leaf) + | type name: github.com/pkg/errors/*errors.fundamental + | reportable 0: + | + | github.com/cockroachdb/errors/fmttests.glob...funcNN... + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2.1 + | : + | github.com/cockroachdb/datadriven.runDirective.func1 + | : + | github.com/cockroachdb/datadriven.runDirective + | : + | github.com/cockroachdb/datadriven.runDirectiveOrSubTest + | : + | github.com/cockroachdb/datadriven.runTestInternal + | : + | github.com/cockroachdb/datadriven.RunTest + | : + | github.com/cockroachdb/errors/fmttests.TestDatadriven.func2 + | : + | github.com/cockroachdb/datadriven.Walk + | : + | github.com/cockroachdb/datadriven.Walk.func1 + | : + | testing.tRunner + | : + | runtime.goexit + | : + Error types: (1) *errbase.opaqueLeaf == Extra "2: details" error domain: pkg == Extra "error types"