onError method

FutureOr<void> onError(
  1. AdapterException error,
  2. ErrorInterceptorHandler handler
)

错误拦截

在发生错误时调用,可以修改错误、返回响应或要求重试。 支持同步或异步实现,异步实现会被适配器 await。

error 错误对象 handler 拦截器处理器

Implementation

FutureOr<void> onError(
  AdapterException error,
  ErrorInterceptorHandler handler,
) {
  handler.next(error);
}