11 months ago

Escape hatch from middleware

Posted 11 months ago by edgreenberg

When I am in middleware, before the request, I would like to escape and return to the caller, not an abort(), but a Response. I've been able to return a redirect, but not a response. What I am after is {"error":"Invalid JSON"} accompanied by 422.

Any ideas on how to do this?

Thanks, Ed

Please sign in or create an account to participate in this conversation.