> > Note that I think your initial proposal would not work as the > finally block is > never reached if return is used from within the > timeout-detection loop: > > if (count >= timeout) { > return -1; > } > > > So I've changed it to use exception handling: > > if (count >= timeout) { > throw new Error("Timeout reached while executing."); > } > That's why you are the developer and I am the user ;-) I am not used to those try..catch constructs, but I am slowly learning. Thanks for the fix. --- Stefan |