Re: user defined error number(s)
Re: user defined error number(s)
- Subject: Re: user defined error number(s)
- From: Luther Fuller <email@hidden>
- Date: Wed, 03 Jun 2009 11:34:10 -0500
On Jun 3, 2009, at 11:17 AM, Jim Brandt wrote:
Is there an accepted available error number to use for
trapping one's own errors?
Yes!
My applications start out something like this ...
on run
try
my main()
on error errText number errNr
if errNr = -128 then
return
else if errNr = -2700 then
my showInstruction(errText)
else
my showError(errText, errNr, false)
end if
end try
end run
If your script has a line such as ...
if x = 0 then error "You can't select that object."
then the error message is passed with default error number = -2700 and
the message is displayed by the showInstruction handler. Any other
error is displayed by the showError handler.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden