Try
this script for error handling/trapping.
It's actually quite pretty, and one of the better uses of Signals I know of. Basically, you execute your command in a Signal -n bubble, which almost acts like creating a new thread... because when the command causes an error, the script still returns where you left off, and you can detect if the signal event didn't finish because commands errored, and trap their messages.
- Raccoon