Why is my BlackBerry exception getMessage () returning null?

I use the following line of code in all my catch operations to print errors to the console:

System.out.println("ERROR MESSAGE " + e.getMessage() );

Sometimes in the console I get the following:

ERROR MESSAGE null

How can it be null? If it reaches catch, it means an exception is thrown, but why is null?

+5
source share
1 answer

I don't know why this is null, I just assume that the BlackBerry OS and API have a lot of undesirable behavior. I solved this problem using

e.toString ()

how in:

catch (Exception e)
{    
    System.out.println("Exception caught: " + e.toString());
}
+6
source

All Articles