Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Adam Arkley 3 posts 72 karma points
    May 03, 2017 @ 20:44
    Adam Arkley
    0

    Application events - the "correct" way...

    Good evening,

    I've been spending some time over the last few days trying to write something to try to catch any unhandled exception, log it and redirect the user to something nice so that the fabled Yellow Screen Of Death is never displayed to an Umbraco user. There seem to be two "recommended" ways of trying this, but I've managed to get neither to work...

    I've spent some time enabling and trying to configure the Global.asax to override the method thrown when the application errors. However, if I alter my Global.asax.cs and have the MVCApplication class inherit from Umbraco.Web.Application, Intellisense informs me that neither OnApplicationError or Application_Error exist. Subsequently, I'm not able to tap into thins from this end.

    After reading a pleathora of documentation, blogs and forum posts about the topic, there are a variety of suggestions that tend to revolve around creating a class of Event Handlers, subscribing to umbracoApplication_Error and having a method that gets called when the event is thrown to perform whatever action needs performing. The event never seemed to be fired.

    Now, I haven't been able to find much in the way of "official" documentation from Our that explains how this might be achieved - is there a "better" method, and has something changed in a more recent release that is preventing either of these attempts from working?

    Cheers!

Please Sign in or register to post replies

Write your reply to:

Draft