Re: Error Handling not Working ASP.NET
From: Matt Berther (mberther_at_hotmail.com)
Date: 05/13/04
- Next message: Gareth: "Has anyone actually managed to create a Forms Authenticated web app with login over SSL?"
- Previous message: Garnet: "RE: HtmlOutputStream"
- In reply to: Rob: "Re: Error Handling not Working ASP.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 02:37:53 -0600
Your code could easily get stuck in a loop in the error handler...
ie: any unhandled exception goes to Application_Error, including any
exceptions thrown in Application_Error.
I've been bitten by this a few times. ;) Best thing to do, is check for
nulls where you can and put a try/catch around everything. An error in
the error handler is pretty pointless.
-- Matt Berther http://www.mattberther.com Rob wrote: > Matt unfortunately this did not work, same result, why would my code > get it stuck in a loop in the first place? > > > > Matt Berther <mberther@hotmail.com> wrote in message news:<u9Sgps5NEHA.3988@tk2msftngp13.phx.gbl>... > >>I'm guessing youre getting stuck in an endless loop, since something in >>your error handler is throwing an error. >> >>Try something like this: >> >>Dim objErr as Exception = Server.GetLastError() >>if (objErr <> null) then >> ' You could perform some loop in here to iterate through the >> ' innerExceptions to get even further into the problem. >> Response.Write(objErr.Message) >> Server.ClearError() >>end if >> >>-- >>Matt Berther >>http://www.mattberther.com >> >>Rob wrote: >> >>>Thank you in advance for your help. >>>I have a response.redirect in my global.asax.vb file to redirect to >>>err.aspx page, upon an error the redirect works fine but in the >>>err.aspx all I simply want to do is write out the error for now and do >>>a bunch of other stuff later, but with the following code, everytime >>>the whole web app freezes up and just sits there and nothing happens!! >>>dim objerr As Exception = Server.GetLastError.GetBaseException >>> >>> >>> Response.Write(objerr.Message.ToString) >>> Server.ClearError() >>>is there too much info in the objerror? (I created a sql error on >>>purpose so all the error should say is Invalid Table name)
- Next message: Gareth: "Has anyone actually managed to create a Forms Authenticated web app with login over SSL?"
- Previous message: Garnet: "RE: HtmlOutputStream"
- In reply to: Rob: "Re: Error Handling not Working ASP.NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|