handle method

  1. @override
Future<DoxResponse> handle(
  1. DoxRequest req,
  2. Next next
)
override

Implementation

@override
Future<DoxResponse> handle(DoxRequest req, Next next) async {
  try {
    return await next().timeout(duration);
  } on TimeoutException {
    throw HttpStatusException(
      HttpStatus.serviceUnavailable,
      message: 'The request took too long',
      errorCode: 'request_timeout',
    );
  }
}