Imported from the Apple Support Forums via the Wayback Machine 🔗
It's not clear quite what you're asking for.
Try/end try blocks are the basis of error trapping - allowing your application to fail gracefully and execute a specific block of code should an error occur. It is not clear what more you're looking for.
0
R C-R·
Imported from the Apple Support Forums via the Wayback Machine 🔗
To elaborate a bit, error handling in a 'try' block is implemented with the 'on error' statement. The simplest use is something like this pseudo-script :
try
{script steps that might produce an error}
on error
{script steps for the error condition}
end try
'on error' optionally will return information about the error. Most widely used are the error message (text) & the error number:
try
{script steps that might produce an error}
on error errMsg number errNum
{script steps for the error condition using the variables errMsg and/or errNum}
end try
The second form allows you to detect & handle specific errors.