Skip to content

Commit cbe2f6d

Browse files
committed
flip positive/negative code paths
1 parent 141b6d8 commit cbe2f6d

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

builder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ type ErrorBuilder struct {
2020
// NewErrorBuilder creates error builder from an existing error type.
2121
func NewErrorBuilder(t *Type) *ErrorBuilder {
2222
getMode := func() callStackBuildMode {
23-
if t.modifiers.CollectStackTrace() {
24-
return stackTraceCollect
23+
if !t.modifiers.CollectStackTrace() {
24+
return stackTraceOmit
2525
}
26-
return stackTraceOmit
26+
return stackTraceCollect
2727
}
2828

2929
return &ErrorBuilder{

wrap.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ func DecorateMany(message string, errs ...error) error {
6565
return nil
6666
}
6767

68-
if areAllOfTheSameType(errs...) {
69-
return WrapMany(transparentWrapper, message, errs...)
68+
if !areAllOfTheSameType(errs...) {
69+
return WrapMany(opaqueWrapper, message, errs...)
7070
}
71-
return WrapMany(opaqueWrapper, message, errs...)
71+
return WrapMany(transparentWrapper, message, errs...)
7272
}
7373

7474
// WrapMany is a utility to wrap multiple errors.

0 commit comments

Comments
 (0)