Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language ReferenceChapter 7 - Control Statements / Try Statements
Signaling Errors in Scripts A script can signal an error--which can then be handled by an error handler--with the Error command. This allows scripts to define their own messages for errors that occur within the script.