addErrorHandler method

  1. @override
DartnessPipeline addErrorHandler(
  1. DartnessErrorHandler errorHandler
)
override

Returns a new DartnessPipeline with errorHandler added to the existing set of handlers.

Implementation

@override
DartnessPipeline addErrorHandler(final DartnessErrorHandler errorHandler) {
  for (final catchError in errorHandler.catchErrors) {
    _catchErrorRegister.addCatchError(catchError);
  }
  final errorHandlerShelf = DartnessErrorHandlerShelf(_catchErrorRegister);
  final pipeline = _pipeline.addMiddleware(errorHandlerShelf.middleware);
  return DefaultDartnessPipeline(pipeline: pipeline);
}