Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 5f5ad88

Browse files
committed
Remove duplicate NotFoundError and rename it to ErrNotFound (idiomatic)
Error had to be defined in its own package to avoid import cycles.
1 parent a201412 commit 5f5ad88

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

client.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"net/url"
88
"strings"
99

10+
"github.com/tyba/srcd-crawler/clients/common"
1011
"github.com/tyba/srcd-crawler/clients/git/pktline"
1112

1213
"github.com/sourcegraph/go-vcsurl"
@@ -35,7 +36,7 @@ func (c *Client) Refs() (*Refs, error) {
3536
}
3637

3738
if res.StatusCode >= 400 {
38-
return nil, &NotFoundError{c.url}
39+
return nil, &common.ErrNotFound{c.url}
3940
}
4041

4142
defer res.Body.Close()
@@ -150,14 +151,6 @@ func (c *Client) applyHeadersToRequest(req *http.Request, content *strings.Reade
150151
}
151152
}
152153

153-
type NotFoundError struct {
154-
url string
155-
}
156-
157-
func (e NotFoundError) Error() string {
158-
return e.url
159-
}
160-
161154
type Refs struct {
162155
defaultBranch string
163156
branches map[string]string

0 commit comments

Comments
 (0)