Skip to content

Commit 11fb29d

Browse files
committed
use correct lib
1 parent 987ba5c commit 11fb29d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

cmd/src/login_oauth.go

Lines changed: 5 additions & 4 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.Newf("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
}
@@ -139,4 +140,4 @@ func openInBrowser(rawURL string) error {
139140
cmd = exec.Command("xdg-open", rawURL)
140141
}
141142
return cmd.Run()
142-
}
143+
}

0 commit comments

Comments
 (0)