Application_Error not hit when RemoteOnly

65 views Asked by At

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;
   }
0

There are 0 answers