mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-10 22:17:44 +00:00
write errors with proper go api
This commit is contained in:
parent
282ff6ef3e
commit
7f8d0c3375
1 changed files with 1 additions and 2 deletions
|
@ -4,6 +4,5 @@ import "net/http"
|
||||||
|
|
||||||
func (a *api) errorResponse(w http.ResponseWriter, r *http.Request, status int, message string) {
|
func (a *api) errorResponse(w http.ResponseWriter, r *http.Request, status int, message string) {
|
||||||
w.Header().Set("X-Apollo-Error", message)
|
w.Header().Set("X-Apollo-Error", message)
|
||||||
w.WriteHeader(status)
|
http.Error(w, message, status)
|
||||||
w.Write([]byte(message))
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue