If I let my script exceptions percolate up to Java, I get correct
stack information about where the exception occurred. However, in
cases where I want to catch the exception in script, conditionally
process it, and maybe re-throw, I don't see how to get the original
exception back. I'm hoping there's an API call that I just missed.
Here's an example
doesThrow = function(){
//stupid, but illustrates the point
throw Math.random();
}
doesRethrow = function(){
try{
doesThrow()
}catch(e){
//half of the errors are caught, half want to be re-thrown
if (e > .5) {
//this is the place where I want to be able to really re-
throw the original
//exception, complete with the stack information that
includes the site
//where the original exception occurred
throw e;
} else {
....//this is ok
}
}
}
I'm still using 1.6, but would consider upgrading to the latest
release if it'd help with this.
Thanks in advance,
A
doesRethrow = function(){
try {
doesThrow();
} catch( e if e > .5 ) {
// ...
}
};
--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
That is helpful,thanks, though I'm still interested if there's answer
to the original question. After I posted this, I realized that it
would also solve my problem if I could manually create some kind of
exception that captured all the stack information.