I am using it inside my code. What I need is to get an exception that
might have ocurred elsewhere else in the code.

For example I have lots of classes that I use to perform specific tasks.
Each of them handles their errors with try Catch blocks.

But further up in the calling chain, I need to know the errors that
might have ocurred in one of these calls. And I dont want to be
returning Exceptions from all the methods of all the classes I call.

How should I do this ?


Can't I find out any where in my code about all the errors that ocurred
during the processing of a specific page ?

-----Original Message-----
From: Marsh, Drew [mailto:[EMAIL PROTECTED]]
Sent: terça-feira, 30 de Abril de 2002 17:23
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] System.Web.HttpServerUtility (Server.GetLastError)


Sérgio Rodelo [mailto:[EMAIL PROTECTED]] wrote:

> How can I use the following class: ?
> 
> Server.GetLastError  " Server is an intrinsic object of the 
> class System.Web.HttpServerUtility "
> 
> Everytime I try to use this class I end up with Nothing 
> returned by the class.

When are you "using" it? GetLastError will only return an exception if
the
error was raised out to the scope of the current HttpContext.
GetLastError
is meant to be used by handlers further down in the call chain that are
doing some form of generic error handling. If you need error checking
within
the scope of your handler, probably a Page instance, you should be using
your language's SEH syntax.

HTH,
Drew

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to