diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-22 13:10:24 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2015-10-22 13:11:33 +0200 |
commit | 6f43e8933ba3c04072d5d104acc6118aac3e52ee (patch) | |
tree | 6015756f3da396c6c578a984e967b070a6c71b58 /client.go | |
parent | ccafe8bd5f9dbfb8b98b0da03ced29608dcfdeec (diff) | |
download | go-git-6f43e8933ba3c04072d5d104acc6118aac3e52ee.tar.gz |
pathsv1.0.0
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -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) +} |