Hi list,
I've got my application running great with Rhino. I'm at the point now
where I want to clean up my exception handling.
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
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino