0

I want to write custom errors and unexpected errors via Global.asax.

In that method I use : var ex = Server.GetLastError(); to obtain the error which ocurred.

However, this code is not hit (or fired) when I set web.config to ErrorMode RemoteOnly. It only works when it's set to Off.

Why is this?

try
   {
 var   sd = db.GetDetails().Single();
   }
   catch (Exception ex)
   {
    //some function here followed by a throw.
    throw;
   }
Rob
  • 3,556
  • 2
  • 34
  • 53
  • possible duplicate of [Application\_Error not firing when customerrors = "On"](http://stackoverflow.com/questions/6508415/application-error-not-firing-when-customerrors-on) – sohaiby Jul 15 '15 at 07:55
  • @sohaiby MVC.. really? – Rob Jul 15 '15 at 08:05

0 Answers0