We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 27d8acc + c01f9d2 commit 190f840Copy full SHA for 190f840
maintenance/errors/context.go
@@ -13,8 +13,12 @@ import (
13
// the optional exposedErr is provided, it is attached as prefix
14
// to the returned error. If the given err is not any of the above
15
// ones, the given exposedErr (if present) is wrapped as prefix
16
-// to the returned error.
+// to the returned error, if there is an err that is not nil.
17
func Hide(ctx context.Context, err, exposedErr error) error {
18
+ if err == nil {
19
+ return nil
20
+ }
21
+
22
ret := errors.New(err.Error())
23
if exposedErr != nil {
24
ret = fmt.Errorf("%w: %s", exposedErr, err)
0 commit comments