Bug reports Found a bug? Post it here please.
Version 4.x > Bug reports > CMSCustomError handler not working on production environment View modes: 
User avatar
Member
Member
henry - 9/22/2009 6:42:46 PM
   
CMSCustomError handler not working on production environment
Hi guys, have a strange issue where our CustomExceptionHandler works fine and displays custom error pages on our development environment, but not on the production/live environment; pretty much used the example project for customeventhandlers

public class CustomExceptionHandler : AbstractExceptionHandler
{
/// <summary>
/// Fires when exception occurs. Performs the additional actions after exception occurs.
/// </summary>
/// <param name="e">Thrown exception</param>
public override void OnException(Exception e)
{
string sErrorPage = Util.GetConfigSetting("App.ErrorRedirectPage");
HttpContext.Current.Response.Redirect(sErrorPage);
}
}


And in both config files, we have:


<add key="CMSUseCustomHandlers" value="true"/>
<add key="CMSCustomHandlersAssembly" value="RGPN.CustomEventHandler"/>
<add key="App.ErrorRedirectPage" value="~/ErrorPage.aspx" />


And the RGPN.CustomEventHandler dll is in the bin directory.

So in development, we get redirected to the ErrorPage.aspx page on the root level of site and it all works fine, but in live it displays the standard ASP.NET error page and doesnt seem to be affected by changing the customerrors in the web.config (on or off doesnt do anything)

Is there anything I am missing or I should check for?

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 10/1/2009 6:08:31 AM
   
RE:CMSCustomError handler not working on production environment
Hi Henry,

Do you use hosting service or your own server? If you use hosting service it's possible they explicitly overrode the customerrors setting in web.config or set it to be ignored. Could you please ask your hosting provider regarding this?

Best Regards,

Martin Dobsicek