Skip to content

Commit 089fa4b

Browse files
committed
use correct lib
1 parent 987ba5c commit 089fa4b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/src/login_oauth.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"runtime"
1010
"time"
1111

12+
"github.com/sourcegraph/sourcegraph/lib/errors"
1213
"github.com/sourcegraph/src-cli/internal/api"
1314
"github.com/sourcegraph/src-cli/internal/cmderrors"
1415
"github.com/sourcegraph/src-cli/internal/oauth"
@@ -109,13 +110,13 @@ func runOAuthDeviceFlow(ctx context.Context, endpoint string, out io.Writer, cli
109110
func validateBrowserURL(rawURL string) error {
110111
u, err := url.Parse(rawURL)
111112
if err != nil {
112-
return fmt.Errorf("invalid URL: %w", err)
113+
return errors.Wrapf(err, "invalid URL: %s", rawURL)
113114
}
114115
if u.Scheme != "http" && u.Scheme != "https" {
115-
return fmt.Errorf("unsupported URL scheme %q: only http and https are allowed", u.Scheme)
116+
return errors.Wrapf(err, "unsupported URL scheme %q: only http and https are allowed", u.Scheme)
116117
}
117118
if u.Host == "" {
118-
return fmt.Errorf("URL has no host")
119+
return errors.New("URL has no host")
119120
}
120121
return nil
121122
}

0 commit comments

Comments
 (0)