Commit 69e6683c authored by Viet Hoang's avatar Viet Hoang

refinery

parent 19647af2
......@@ -58,6 +58,11 @@ protected string GetNotFoundPageContent(HttpRequestArgs args)
var notFoundItem = NotFoundItemService.GetItemBySiteProperty(Context.Site, Constants.SiteInfo.Properties.NotFoundItem);
var url = notFoundItem != null ? LinkManager.GetItemUrl(notFoundItem) : NotFoundItemService.GetRelativeFilePathBySiteProperty(Context.Site, Constants.SiteInfo.Properties.FallbackNotFoundItem);
if (string.IsNullOrWhiteSpace(url))
{
return string.Empty;
}
try
{
var content = WebUtil.ExecuteWebPage(string.Concat(domain, url));
......
......@@ -33,12 +33,19 @@ public override void Process(ExceptionArgs args)
}
var errorPageUrl = site.Properties[Constants.SiteInfo.Properties.CustomErrorFile];
if (string.IsNullOrWhiteSpace(errorPageUrl))
{
return;
}
httpContext.Server.ClearError();
httpContext.Response.Redirect(errorPageUrl, false);
httpContext.Response.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError;
httpContext.Server.Execute(errorPageUrl);
}
catch (Exception ex)
{
Log.Error($"{this} {typeof(Process)} : {ex.Message}'", ex, this);
Log.Error($"{this} {typeof(Process)} : {ex.StackTrace}'", ex, this);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment