apollo-backend/internal/api/errors.go

10 lines
224 B
Go
Raw Normal View History

package api
import "net/http"
func (a *api) errorResponse(w http.ResponseWriter, r *http.Request, status int, message string) {
2021-08-08 18:19:47 +00:00
w.Header().Set("X-Apollo-Error", message)
w.WriteHeader(status)
w.Write([]byte(message))
}