On 18 Sep 2006 20:15:55 GMT, "Evertjan."
<ex**************@interxnl.netwrote:
>try{}catch(){} can only grracefully back out from an error,
if you know the kind of error expected,
and so has only very linmited use in a "production" environment.
except of couse in script, where the speed advantages gainable in
using try/catch can be huge.
e.g. if you want to get an optional value from an xml document
try {
x=element.getElementsByTagNameNS(chickenNS,"egg")[0].firstChild.nodeValue;
} catch (e) {
x="hen";
}
is much faster than checking every part. certianly there's a chance
you will catch another error, which shouldn't be caught - but it's not
too likely assuming you've also already tested the other likely
failures.
Jim.