Defines the interceptor for a Response error. This allows you to intercept a response error before exiting the whole process. You can either rethrow an error, and resolve with a different response.
Response
You must return either:
throw error
Promise.reject(error)
Reports error to tracking service:
const reportErrorToTrackingService: ResponseErrorInterceptor = async ({ request, error,}: { request: Request error: unknown}) => { await sendErrorToErrorService(request, error) throw error} Copy
const reportErrorToTrackingService: ResponseErrorInterceptor = async ({ request, error,}: { request: Request error: unknown}) => { await sendErrorToErrorService(request, error) throw error}
Defines the interceptor for a
Response
error. This allows you to intercept a response error before exiting the whole process. You can either rethrow an error, and resolve with a different response.Remarks
You must return either:
throw error
orPromise.reject(error)
)Example
Reports error to tracking service: