diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Pages/Error/Index.cshtml b/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Pages/Error/Index.cshtml index a20b9088ca..71bf8a08a6 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Pages/Error/Index.cshtml +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Pages/Error/Index.cshtml @@ -15,7 +15,7 @@ }

- [@Model.HttpStatusCode] @errorMessage + [@Model.HttpStatusCode] @errorMessage

diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Pages/Error/Index.cshtml.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Pages/Error/Index.cshtml.cs index fc83f40012..15f2fc9b1c 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Pages/Error/Index.cshtml.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Pages/Error/Index.cshtml.cs @@ -15,10 +15,12 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Pages.Error public int HttpStatusCode { get; set; } private readonly IExceptionToErrorInfoConverter _errorInfoConverter; + private readonly IHttpExceptionStatusCodeFinder _statusCodeFinder; - public IndexModel(IExceptionToErrorInfoConverter errorInfoConverter) + public IndexModel(IExceptionToErrorInfoConverter errorInfoConverter, IHttpExceptionStatusCodeFinder statusCodeFinder) { _errorInfoConverter = errorInfoConverter; + _statusCodeFinder = statusCodeFinder; } public void OnGet() @@ -33,8 +35,10 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Pages.Error if (HttpStatusCode == 0) { - HttpStatusCode = HttpContext.Response.StatusCode; + HttpStatusCode = (int)_statusCodeFinder.GetStatusCode(HttpContext, exception); } + + HttpContext.Response.StatusCode = HttpStatusCode; } } } \ No newline at end of file diff --git a/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingManagerSyncExtensions.cs b/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingManagerSyncExtensions.cs index 0a8c7b2981..e5d31bd16c 100644 --- a/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingManagerSyncExtensions.cs +++ b/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingManagerSyncExtensions.cs @@ -23,7 +23,7 @@ namespace Volo.Abp.Settings public static T Get([NotNull] this ISettingManager settingManager, [NotNull] string name, T defaultValue = default) where T : struct { - return AsyncHelper.RunSync(() => settingManager.GetAsync(name, defaultValue)); + return AsyncHelper.RunSync(() => settingManager.GetAsync(name, defaultValue)); } public static bool IsTrue([NotNull] this ISettingManager settingManager, [NotNull] string name)