Transform globally response when error occurs
Hi all, I'm creating a new instance of $fetch and I am adding onResponseError interceptor to try to transform the response data when error occurs.
I want to send the error payload already transformed from the interceptor so that when I use .catch it get the error already transformed.
But i couldn't make it happen. Any changes that I make within onResponseError method doesn't replicate to .catch
Any tricks?
@tiagomatosweb
I'm not 100% sure what you want to achieve, and according to the date you created this issue, I guess you tried it with ohfetch v0.4.18 at most.
I appreciate if you provide more information (e.g. code sample), so that we could understand what your needs.
Especially, I'm not sure what the sentence below means:
I want to send the error payload already transformed from the interceptor so that when I use .catch it get the error already transformed.
Where do you want to send in the interceptor?
closing due to inactivity.