handle method
Implementation
@override
Future<DoxResponse> handle(DoxRequest req, Next next) async {
Future<DoxResponse> work = next();
try {
return await work.timeout(duration);
} on TimeoutException {
/// the late handler may still read the upload temp files
keepTempFilesUntil(req.httpRequest, work.then((_) {}, onError: (_) {}));
throw HttpStatusException(
HttpStatus.serviceUnavailable,
message: 'The request took too long',
errorCode: 'request_timeout',
);
}
}