I'm trying to create some basic logging for unhandled exceptions in my ASP.NET MVC application, but as I'm using IIS6 all requests come through .NET. Now while I agree that missing images are an important thing to flag, they aren't show-stoppers and so I'd like to set the event priority to high for 404s unless they are images (which will get medium priority).
The problem is that in Application_OnError the Response.StatusCode is 200, but the final result sent out is 404. To this end, I don't seem to be able to watch out for 404s to set the appropriate priority.
Is there a way to tell what the StatusCode is going to be?