Re: installing a session-level error handler?

Discussion in 'ASP .Net' started by George Birbilis, Nov 6, 2003.

  1. (please read from bottom to top to follow the whole thread)

    btw, at "global.asax.vb" there are methods like:

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

    that one does implement (not event handlers, neither overriden methods, just
    plain methods [maybe the runtime uses reflection or the compiler for
    global.asax later makes a proper class out of those methods])

    there are Session_Start/Session_End methods also there

    there's an Application_Error method for untrapped error handling, but I
    couldn't find any Session_Error method to implement (maybe there's one or I
    don't know where to find it?)

    so my suggestion to MS would be to maybe ALSO add a "Session_Error" method
    at "global.asax.vb" that will catch errors not caught by Pages themselves
    (either via their try/catch or Page_Error event handlers). Then one wouldn't
    need to subclass Page to have a global session error handler for all their
    Pages, they could just implement Session_Error (as a reentrant/freethreaded
    routine) at global.asax code file

    sincerely,
    George

    > thanks a lot,
    > I wonder how I hadn't noticed the "Error" event at the Page class

    (inherited
    > from TemplateControl) and had only spotted the one at global.asax
    >
    > I use a custom base class already, so it's fine
    >
    > cheers,
    > George
    >
    > > There is no concept of a 'session level' as far as catching errors.
    > >
    > > I recommend you make a base page class that inherits from the Page class
    > > that handles the Error event. Then have all your pages inherit from

    this
    > > page - and all their errors should be handled on the page level.
    > >
    > > > Hi all,
    > > > I'd like to have an error handler proc installed that can grab

    unhandled
    > > > errors during a Session before the Session object goes down. I mainly

    > want
    > > > to log some info kept at the session state upon such an exception,

    > before
    > > I
    > > > propagate it to the system again
    > > >
    > > > Now I'm catching the errors at global.asax.vb which is too late, since

    > > it's
    > > > at the Application level and the Session has already died. So I can

    only
    > > log
    > > > user's IP address, the error trace and the page it happened at, but

    not
    > > the
    > > > username, nor other info related to my application (schoolyear etc.)
    > > >
    > > > thanks in advance for any insights to that,
    > > > George
    > > >
    > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    > > > George Birbilis <>
    > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    > > > + QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
    > > > + Plugs VCL and ActiveX controls (InterProcess/Internet communication)
    > > > + TransFormations, VB6 forms to ASP.net WebForms convertion
    > > > http://www.kagi.com/birbilis
    > > > + Robotics
    > > > http://www.mech.upatras.gr/~robgroup
    > > >

    .........................................................................
     
    George Birbilis, Nov 6, 2003
    #1
    1. Advertising

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. George Birbilis

    installing a session-level error handler?

    George Birbilis, Nov 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    341
    George Birbilis
    Nov 6, 2003
  2. shruds
    Replies:
    1
    Views:
    870
    John C. Bollinger
    Jan 27, 2006
  3. Replies:
    1
    Views:
    726
    Damien
    Feb 22, 2007
  4. pabbu
    Replies:
    8
    Views:
    739
    Marc Boyer
    Nov 7, 2005
  5. Replies:
    0
    Views:
    365
Loading...

Share This Page