Blackberry has not such mechanism like Thread.setDefaultUncaughtExceptionHandler
on Android or NSSetUncaughtExceptionHandler
on iOS.
I recommend to use a proposal described in this post
public class MyApp
{
public static void main(String[] args)
{
try {
new MyApp().enterEventDispatcher();
} catch (Exception e) {
// handle exeption
}
}
}
If you use own Thread
subclasses or Runnable
implementations, you should also catch
all Exceptions in run()
method
P.S. Also there is no way to get stack-trace as string you only able to print it to stdout