mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-22 22:35:27 +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) {
|
||||
w.Header().Set("X-Apollo-Error", message)
|
||||
w.WriteHeader(status)
|
||||
w.Write([]byte(message))
|
||||
http.Error(w, message, status)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue