mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 13:17:42 +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