call method

FutureOr<Response> call({
  1. required Request request,
  2. required RequestResponseHandler normalExecutionFlow,
  3. ExceptionHandler? onExceptionHandler,
})

Implementation

FutureOr<Response> call({
  required Request request,
  required RequestResponseHandler normalExecutionFlow,
  ExceptionHandler? onExceptionHandler,
}) async {
  try {
    return await normalExecutionFlow(request);
  } on ResponseException catch (exception) {
    if (onExceptionHandler != null) {
      return onExceptionHandler.handle(exception.runtimeType, exception);
    } else {
      return this.onExceptionHandler.handle(exception.runtimeType, exception);
    }
  }
}