Example #1
0
 /// <summary>
 /// Creates and instance of <see cref="ExceptionHandlingMiddleware"/>
 /// </summary>
 /// <param name="next">Next <see cref="RequestDelegate"/> to be executed after <see cref="ExceptionHandlerDefinition"/> invocation.</param>
 /// <param name="exceptionManager"><see cref="IExceptionManager"/> added to the middleware</param>
 /// <param name="exceptionCodesDecider"><see cref="IExceptionCodesDecider"/> to be used in <see cref="ExceptionFilter"/></param>
 /// <param name="actionResultHandler"><see cref="IActionResultHandler"/> used to handle created <see cref="IExceptionManager"/></param>
 public ExceptionHandlingMiddleware(
     RequestDelegate next,
     IExceptionManager exceptionManager,
     IExceptionCodesDecider exceptionCodesDecider,
     IActionResultHandler actionResultHandler)
 {
     _next                  = next ?? throw new ArgumentNullException(nameof(next));
     _exceptionManager      = exceptionManager ?? throw new ArgumentNullException(nameof(exceptionManager));
     _exceptionCodesDecider = exceptionCodesDecider ?? throw new ArgumentNullException(nameof(exceptionCodesDecider));
     _actionResultHandler   = actionResultHandler ?? throw new ArgumentException(nameof(actionResultHandler));
 }
Example #2
0
 /// <summary>
 /// Creates an instance of <see cref="ExceptionFilter"/> with <see cref="IExceptionManager"/>
 /// </summary>
 /// <param name="exceptionManager"><see cref="IExceptionManager"/> to be used in <see cref="ExceptionFilter"/></param>
 /// <param name="exceptionCodesDecider"><see cref="IExceptionCodesDecider"/> to be used in <see cref="ExceptionFilter"/></param>
 public ExceptionFilter(IExceptionManager exceptionManager, IExceptionCodesDecider exceptionCodesDecider)
 {
     _exceptionManager      = exceptionManager;
     _exceptionCodesDecider = exceptionCodesDecider;
 }