You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the interceptor in our application not for mocking, but for intercepting all requests made to (trace/debug) log all requests and responses and some metadata request id, duration, ...
We had the problem that some of the requests fail due to network issues ("socket hang up", "connection refused", ...) that lead to an error instead of an actual response.
The problem is that there is no event that is available to listen for an error like that. Is there any possibility to either implement an "error" listener or are there any workaround to get the error in the interceptor?
The text was updated successfully, but these errors were encountered:
What would classify for the "error" event? Any request error?
I can imagine a usage like this:
interceptor.on('request:error',({ request, cause })=>{console.log('request failed due to:',cause)})
Where cause is the original error that resulted in the request's failure.
I think people would want for the request:error event to maintain the request's context so they would be able to retry it. Interceptors currently doesn't support affecting requests at this stage. Request error implies the request was passthrough—it hasn't been handled in the request event. I see this new event as readonly.
How does that compare to your vision of this event and its usage?
We are using the interceptor in our application not for mocking, but for intercepting all requests made to (trace/debug) log all requests and responses and some metadata request id, duration, ...
We had the problem that some of the requests fail due to network issues ("socket hang up", "connection refused", ...) that lead to an error instead of an actual response.
The problem is that there is no event that is available to listen for an error like that. Is there any possibility to either implement an "error" listener or are there any workaround to get the error in the interceptor?
The text was updated successfully, but these errors were encountered: