I have a chain of claw http.Handler
middlewares, where my first handler might write an error response:
http.Error(w, err.Error(), http.StatusUnauthorized)
However my other middlewares continue executing, but I don't want it to. What is the best way to go about this? I tried checking the status header after calling http.Error()
, to see if it is other than a 200:
status := w.Header().Get("Status")
but status is an empty string.