BlackBerry only provides stack traces when you catch Throwable. Thus, you should be able to use printStackTrace and friends if you change the catch type.
EDIT Sorry, I misunderstood your question - thanks for the comment. No, there is no way to get the stack trace in a String object. In January 2010, there is a support forum topic that covers this: Capturing a stack trace (extremely necessary) . Since then, nothing has changed.
If you need this for development, you can extract the event log from the device , which includes stack traces. But this does not help solve production problems.
Michael donohue
source share