diff --git a/api/error.go b/api/error.go deleted file mode 100644 index 2c60438..0000000 --- a/api/error.go +++ /dev/null @@ -1,11 +0,0 @@ -package api - -import ( - "log" - "net/http" -) - -func httpError(w http.ResponseWriter, r *http.Request, err error, code int) { - log.Printf("%s: %s\n", r.URL.Path, err) - http.Error(w, err.Error(), code) -} diff --git a/api/generic.go b/api/generic.go index 81af22e..05a9090 100644 --- a/api/generic.go +++ b/api/generic.go @@ -5,6 +5,7 @@ import ( "encoding/gob" "encoding/json" "fmt" + "log" "net/http" "strconv" @@ -263,6 +264,11 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { } } +func httpError(w http.ResponseWriter, r *http.Request, err error, code int) { + log.Printf("%s: %s\n", r.URL.Path, err) + http.Error(w, err.Error(), code) +} + // auth type GenericAuthRequest struct {