I guess 'printStackTrace()' method of 'Exception' can be of some help at
least in some context.

On the other hand, if have a big chunk of code and you want to want to find
out which line is causing the exception, without really understanding the
code, my approach is to do some think like this:

int step =0;
try {
<some chunk of code>
step = 10;
<some junk of code>
step = 20;
..
..
}
catch (Exception ex) {
        CSpLog.send(..,"Failed after step"+step+";"+ex)
}

Now if I find that it failed between step 10 and 20, I insert a few more
steps inside that piece of code.
Within a few iteration you catch that line red-handed. I have found this
very effective, though not very elegant.

Aby
TeamND

> -----Original Message-----
> From: Ray [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 09, 1999 11:29 AM
> To: [EMAIL PROTECTED]
> Subject: [ND] Getting Name of Method Throwing an Exception
> 
> 
> 
> Does anyone know what method(s) to call that will return the 
> name of the method
> that threw an exception?  E.g.:
> 
> try {
>   ......... some code
> }
> catch (NullPointerException ex) {
>    // It's here I want to know what method threw NullPointerException
> }
> 
> ______________________________________________________________
> ___________
> 
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to: 
> http://www.netdynamics.com/support/visitdevfor.html
> 
> For dire need help, email: [EMAIL PROTECTED]
> 
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to