Closed fhalde closed 1 year ago
Hi,
I think both are correct depending how you want the flow to work. For example, you could just terminate on a 404 with a nil
body and do nothing with the result, but perhaps on a 400 or 500 you want to catch an exception and log or tell the user about it.
In both cases, the leave
phase finishes. If you terminate then the interceptor chain stops immediately, if you throw an error then you will only process :error
handles on your interceptor stack. This can be useful if you have things like metrics or logging early on which you still want to trigger.
Hope this helps
Closing this for now, please let me know if you need any more help.
Cheers
What would be the right interceptor for this purpose? Should my interceptor return a tc/terminate or can it just throw an exception?