コード例 #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());
        }
コード例 #2
0
 public virtual Task OnError(TypedErrorContext context)
 {
     return(Task.FromResult(true));
 }
コード例 #3
0
 public TypedErrorContext(TypedErrorContext context)
     : base(context)
 {
 }