import { FetchOptions } from "./requestInterceptor";

export interface ErrorInterceptorArgs {
  error: Error;
  options: {
    type: string;
    url: string;
    args: {
      options: FetchOptions;
      startTime: number;
      endTime: number;
    };
  };
}

export type ErrorInterceptorValue = ErrorInterceptorArgs | void;

export type ErrorInterceptor = (
  params: ErrorInterceptorArgs
) => ErrorInterceptorValue;
