aboutsummaryrefslogtreecommitdiffstats
path: root/client.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2015-10-22 13:10:24 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2015-10-22 13:11:33 +0200
commit6f43e8933ba3c04072d5d104acc6118aac3e52ee (patch)
tree6015756f3da396c6c578a984e967b070a6c71b58 /client.go
parentccafe8bd5f9dbfb8b98b0da03ced29608dcfdeec (diff)
downloadgo-git-6f43e8933ba3c04072d5d104acc6118aac3e52ee.tar.gz
pathsv1.0.0
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)
+}