HttpServerUtility.GetLastError Timing issue?

Discussion in 'ASP .Net' started by Brendan Erwin, Dec 2, 2003.

  1. 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.
     
    Brendan Erwin, Dec 2, 2003
    #1
    1. Advertisements

  2. Brendan Erwin

    bruce barker Guest

    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)


    "Brendan Erwin" <> wrote in message
    news:0cc801c3b8e3$d539d550$...
    > 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.
     
    bruce barker, Dec 2, 2003
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Supriya
    Replies:
    0
    Views:
    531
    Supriya
    Jul 1, 2003
  2. Replies:
    1
    Views:
    3,192
    S. Justin Gengo
    Oct 10, 2005
  3. =?Utf-8?B?Sm9l?=
    Replies:
    19
    Views:
    9,313
    Daryn
    May 22, 2008
  4. =?Utf-8?B?UGF0cmljayBG?=

    How to use HttpServerUtility?

    =?Utf-8?B?UGF0cmljayBG?=, Feb 14, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    23,699
    isaiyavan
    Jul 4, 2008
  5. =?Utf-8?B?QXJuZQ==?=

    HttpServerUtility instance method

    =?Utf-8?B?QXJuZQ==?=, Aug 17, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    457
    =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?=
    Aug 17, 2007
Loading...

Share This Page