I have exceptions thrown in my java code when an error occurs. I then run the code using jdb so when the exception occurs, I can see the state that the code is in and debug. For all exceptions that I throw, I put in a useful string message. However, when jdb catches the exception, it doesn't print this string along with it. How do I print this string?
I have googled and searched and read the documentation but I can't figure out how.
If I have the test class:
public class Test{
public static void main(String[] args){
throw new IllegalArgumentException("How do I view this string through jdb?");
}
}
And run it through jdb:
$ jdb Test
Initializing jdb ...
> run
run Test
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started:
Exception occurred: java.lang.IllegalArgumentException (uncaught)"thread=main", Test.main(), line=3 bci=9
main[1]