HttpServerUtility.GetLastError Timing issue?

  • Thread starter Thread starter Brendan Erwin
  • Start date Start date
B

Brendan Erwin

Looking for some clarification here. I'm considering using
HttpServerUtility.GetLastError in a standard errorhandler
for all my pages. (Inherits System.Web.UI.Page and
overrides OnError.) My concern is that I think there MAY
be a timing issue with the GetLastError method as it is a
method of the HttpSERVERUtility class.
When an exception is thrown within a page and triggers the
OnError method, how am I guaranteed that the exception
returned by GetLastError is the same exception that
triggered the OnError method? It seems to me, from the
location of the GetLastError method, that, if 2 pages
threw exceptions at just the right times, I could be
handling the wrong exceptions.
Thanks for any assistance.
 
there is no problem. aspx page processing is context bound, and the
GetLastError uses the current context to get the error message, simular to
the Session Cache.

-- bruce (sqlwork.com)
 
Back
Top