Beispiel #1
0
        public async Task <Modifiable> OnError(ITypedBuilderContext context, HttpRequestMessage request, HttpResponseMessage response, object error)
        {
            TypedErrorContext handlerContext = null;

            foreach (var handlerInfo in GetHandlerInfo(HandlerType.Error))
            {
                if (handlerContext == null)
                {
                    handlerContext = ((Func <ITypedBuilderContext, HttpRequestMessage, HttpResponseMessage, object, TypedErrorContext>)handlerInfo.InitialConstructor)(context, request, response, error);
                }
                else
                {
                    handlerContext = ((Func <TypedErrorContext, TypedErrorContext>)handlerInfo.ContinuationConstructor)(handlerContext);
                }

                await handlerInfo.Handler(handlerContext);
            }

            return(handlerContext?.GetHandlerResult());
        }
 public virtual Task OnError(TypedErrorContext context)
 {
     return(Task.FromResult(true));
 }
 public TypedErrorContext(TypedErrorContext context)
     : base(context)
 {
 }