Skip to content

Commit b00e2b0

Browse files
authored
[errors] use pkg errors instead of std errors (#1174)
## Summary "github.com/pkg/errors" wraps some functions of `errors` (like `Is` and `Unwrap`), so it's okay to use those functions provided by the former. ## How was it tested?
1 parent a7f7e07 commit b00e2b0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

internal/telemetry/sentry.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"crypto/rand"
88
"encoding/hex"
99
"encoding/json"
10-
"errors"
1110
"io/fs"
1211
"os"
1312
"os/exec"
@@ -23,7 +22,7 @@ import (
2322
"unicode/utf8"
2423

2524
"github.com/getsentry/sentry-go"
26-
pkgerrors "github.com/pkg/errors"
25+
"github.com/pkg/errors"
2726

2827
"go.jetpack.io/devbox/internal/build"
2928
"go.jetpack.io/devbox/internal/envir"
@@ -297,7 +296,7 @@ func newSentryException(err error) []sentry.Exception {
297296
case interface{ StackTrace() []runtime.Frame }:
298297
stFunc = stackErr.StackTrace
299298
// Otherwise use the pkg/errors StackTracer interface.
300-
case interface{ StackTrace() pkgerrors.StackTrace }:
299+
case interface{ StackTrace() errors.StackTrace }:
301300
// Normalize the pkgs/errors.StackTrace type to a slice of runtime.Frame.
302301
stFunc = func() []runtime.Frame {
303302
pkgStack := stackErr.StackTrace()

0 commit comments

Comments
 (0)