diff --git a/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs b/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs index 952612e1b..4df387198 100644 --- a/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs +++ b/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs @@ -23,9 +23,9 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling { protected override bool ShouldHandleException(PageHandlerExecutingContext context) { - if (!context.ActionDescriptor.CanWarpRsult()) + if (context.ActionDescriptor.CanWarpRsult()) { - return false; + return true; } return base.ShouldHandleException(context); } diff --git a/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs b/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs index fc590d414..96c13e746 100644 --- a/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs +++ b/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs @@ -26,9 +26,9 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling { var wrapResultChecker = context.GetRequiredService(); - if (!wrapResultChecker.WrapOnException(context)) + if (wrapResultChecker.WrapOnException(context)) { - return false; + return true; } return base.ShouldHandleException(context); } @@ -55,7 +55,6 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling await context.GetRequiredService().NotifyAsync(new ExceptionNotificationContext(context.Exception)); - context.HttpContext.Response.Headers.Add(AbpHttpConsts.AbpErrorFormat, "true"); context.HttpContext.Response.Headers.Add(AbpHttpWrapConsts.AbpWrapResult, "true"); context.HttpContext.Response.StatusCode = (int)wrapResultOptions.HttpStatusCode;