Catching Framework Errors

Discussion in 'ASP .Net' started by TonyG, Aug 23, 2003.

  1. TonyG

    TonyG Guest

    My site uses the fairly standard approach of trapping errors in the
    Application_Error event and dealing with them there.

    However, we occasionally get errors that are generated by the Framework
    itself and are this not trappeable by our ASP.Net code.

    A good example is if someone requests a page just as the site DLL is
    being uploaded, an error such as "Cannot access file XXXXXX as it is
    being used by another process" is generated.

    These errors are dreadful for a number of reasons.

    1). They are butt ugly
    2). They contain a plethora of sensitive information including
    details like dll name, appBase, drive paths etc etc.
    3). They do not appear to be trappeable

    MY question is this. How can I catch these pages and deal with them in a
    more graceful manner?

    I NEED to be able to serve a custom page to my users as this page is a
    horror.

    Any help would be very gratefully received.

    --
    Tony G
    TonyG, Aug 23, 2003
    #1
    1. Advertising

  2. It works, I was able to get to the custom error page when the .dll is
    missing
    Here is what you have to do

    1- in web.confg add the following line, save the file
    <customErrors mode="On" defaultRedirect="mycustompage.htm"/>

    2- create the mycustompage.htm and place your custom error in there, save
    the file

    3- remove the .dll of your project from the bin directory

    4- Open IE and try to open your project

    5- You will get your Custom Error

    6- Return the .dll back to the bin Directory of your project

    7- Refresh the browser and you still see the custom error

    8- Close I.E.

    9- Reopen IE and open your Project

    10- Back to normal

    That's it, you are done

    conclusion: ASP.NET looks into your web.config first which is good even if
    you have no .dll in your bin directory

    any other comments are welcome.

    "TonyG" <> wrote in message
    news:O$...
    > My site uses the fairly standard approach of trapping errors in the
    > Application_Error event and dealing with them there.
    >
    > However, we occasionally get errors that are generated by the Framework
    > itself and are this not trappeable by our ASP.Net code.
    >
    > A good example is if someone requests a page just as the site DLL is
    > being uploaded, an error such as "Cannot access file XXXXXX as it is
    > being used by another process" is generated.
    >
    > These errors are dreadful for a number of reasons.
    >
    > 1). They are butt ugly
    > 2). They contain a plethora of sensitive information including
    > details like dll name, appBase, drive paths etc etc.
    > 3). They do not appear to be trappeable
    >
    > MY question is this. How can I catch these pages and deal with them in a
    > more graceful manner?
    >
    > I NEED to be able to serve a custom page to my users as this page is a
    > horror.
    >
    > Any help would be very gratefully received.
    >
    > --
    > Tony G
    >
    MS News \(MS ILM\), Aug 26, 2003
    #2
    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. Mikael Engdahl

    Catching ASP.NET errors

    Mikael Engdahl, Aug 15, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,365
    S. Justin Gengo
    Aug 15, 2003
  2. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    927
    Mark Goldin
    Jan 17, 2004
  3. darrel
    Replies:
    0
    Views:
    307
    darrel
    Sep 28, 2005
  4. SenthilVel
    Replies:
    0
    Views:
    931
    SenthilVel
    Jun 7, 2006
  5. yawnmoth
    Replies:
    97
    Views:
    4,657
    Bent C Dalager
    Feb 27, 2009
Loading...

Share This Page