aboutsummaryrefslogtreecommitdiffstats
path: root/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client.go')
-rw-r--r--client.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/client.go b/client.go
index 616dd8d..78ddbb7 100644
--- a/client.go
+++ b/client.go
@@ -7,8 +7,7 @@ import (
"net/url"
"strings"
- "github.com/src-d/crawler/clients/common"
- "github.com/src-d/crawler/clients/git/pktline"
+ "gopkg.in/src-d/go-git.v1/pktline"
"github.com/sourcegraph/go-vcsurl"
)
@@ -36,7 +35,7 @@ func (c *Client) Refs() (*Refs, error) {
}
if res.StatusCode >= 400 {
- return nil, &common.ErrNotFound{c.url}
+ return nil, &ErrNotFound{c.url}
}
defer res.Body.Close()
@@ -167,3 +166,15 @@ func (r *Refs) DefaultBranchCommit() string {
func (r *Refs) Branches() map[string]string {
return r.branches
}
+
+type ErrNotFound struct {
+ url string
+}
+
+func (e *ErrNotFound) Url() string {
+ return e.url
+}
+
+func (e *ErrNotFound) Error() string {
+ return fmt.Sprintf("Unable to find %q", e.url)
+}