Is it possible to get a Stack Trace in the code?
I am using Exception.printStackTrace during development on the emulator, but I would like to get it as a string in the code.
I have error reporting feature in my Midlet so it sends info about cought exceptions to the server. Stack Trace would be wonderful, but it is only possible to write it to the standard output.
Any way to redirect it to the string?
Greetings,
Aleksandar Momcilovic
Oslo, Norway
[438 byte] By [
amomcila] at [2007-11-26 17:47:42]

# 5
Thanks guys, I managed to get more info about this silly omission with the same result - Not possible.So, no way to send Stack Trace back to home, that is very sad news.
# 6
> Thanks guys, I managed to get more info about this> silly omission with the same result - Not possible.> So, no way to send Stack Trace back to home, that is> very sad news.did you really try Alert objects?
# 7
What does an Alert have in common with the stack trace of an exception? There are even J2ME devices with no screen at all, e.g. in the IM profile (as in my case at the moment) and still there's a need to process the stack trace somehow. Unfortunately, it seems to be not possible at all.
# 8
> What does an Alert have in common with the stack
> trace of an exception? There are even J2ME devices
> with no screen at all, e.g. in the IM profile (as in
> my case at the moment) and still there's a need to
> process the stack trace somehow. Unfortunately, it
> seems to be not possible at all.
i explain...
you write some code with something critical...
try{
// i try something really critical
}catch(Exception e){
// create an Alert with the Exception message inside
// display the alert
Alert alert = new Alert (e.toString());
alert.setTimeout (Alert.FOREVER);
display.setCurrent (alert);
}
so when the critical code throws an Exception, the alert will be displayed
with the exception message inside and the application will not freeze
am i clear?
# 9
> so when the critical code throws an Exception, the
> alert will be displayed
> with the exception message inside and the application
> will not freeze
As said:
1. the message is useless in most cases. There was explicitly asked for the STACKTRACE!!! Nothing else.
2. Some devices do not have a display