Skip to content
This repository was archived by the owner on Nov 5, 2019. It is now read-only.

Commit 6639f90

Browse files
committed
merge errors package into repo
1 parent 9281ba9 commit 6639f90

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

Godeps/Godeps.json

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/datatogether/errors/errors.go renamed to errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// TODO - remove this in favour of either returning a generic "Not Found" string
22
// or putting not found in a common package
3-
package errors
3+
package main
44

55
import (
66
"fmt"

handlers.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"github.com/datatogether/api/apiutil"
55
"github.com/datatogether/coverage/tree"
6-
"github.com/datatogether/errors"
76
"io"
87
"net/http"
98
)
@@ -27,7 +26,7 @@ func NodeHandler(w http.ResponseWriter, r *http.Request) {
2726
id := r.URL.Path[len("/tree/"):]
2827
node := t.Find(id)
2928
if node == nil {
30-
apiutil.WriteErrResponse(w, http.StatusNotFound, errors.ErrNotFound)
29+
apiutil.WriteErrResponse(w, http.StatusNotFound, ErrNotFound)
3130
return
3231
}
3332
apiutil.WriteResponse(w, tree.CopyToDepth(node, 1))

repositories/repository_requests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package repositories
22

33
import (
4+
"fmt"
45
"github.com/datatogether/core"
5-
"github.com/datatogether/errors"
66
)
77

88
type RepositoryRequests int
@@ -34,5 +34,5 @@ func (r RepositoryRequests) Get(p *RepositoryGetParams, res *core.DataRepo) erro
3434
return nil
3535
}
3636
}
37-
return errors.ErrNotFound
37+
return fmt.Errorf("Not Found")
3838
}

vendor/github.com/datatogether/errors/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)