dcsimg
Getting line number and function name
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bill_Harry
Posted On:   Monday, August 5, 2002 03:23 PM

Hello,

I am trying to trap the line number and the name of the function after getting an exception. Can anyone show me how to retrieve the error line number and the corresponding function name in JAVA ?

Thanks

RB.

Re: Getting line number and function name

Posted By:   zhaohua_meng  
Posted On:   Monday, August 5, 2002 05:23 PM

You can always put a try {} catch (Exception e) {} block to
get a stack trace. The stack trace tells you exactly where the exception is thrown.


Example:


try {
//you code that throws exception
} catch (Exception e) {
e.printStackTrace();
}

Re: Getting line number and function name

Posted By:   eimi_nos  
Posted On:   Monday, August 5, 2002 05:17 PM

Try this.



try {
// ...
}catch(Exception e){
e.printStackTrace();
}

About | Sitemap | Contact