I noticed that the response generated by send_resp
in the handle_errors
callback of Plug.ErrorHandler
does not pass through other Plugs.
For example, I build a JSON response in handle_error
. But this JSON response won't pass my JSONHeaderPlug
and CORSPlug
. This has brought a lot of trouble.
Specific symptoms such as the lack of these essential HTTP headers:
access-control-allow-credentials: true
access-control-allow-origin: *
access-control-expose-headers:
content-type: application/json; charset=utf-8
Is there a way to let the response in handle_error
pass through other Plugs in the same order as the normal response?