apollo-backend/internal/api/errors.go
André Medeiros f9b9c595cf Better testing (#62)
* some tests

* more tests

* tidy up go.mod

* more tests

* add postgres

* beep

* again

* Set up schema

* fix device test
2022-05-07 12:37:21 -04:00

8 lines
207 B
Go

package api
import "net/http"
func (a *api) errorResponse(w http.ResponseWriter, _ *http.Request, status int, message string) {
w.Header().Set("X-Apollo-Error", message)
http.Error(w, message, status)
}