• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
user defined error number(s)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

user defined error number(s)


  • Subject: user defined error number(s)
  • From: Jim Brandt <email@hidden>
  • Date: Wed, 3 Jun 2009 11:17:03 -0500

Is there an accepted available error number to use for
trapping one's own errors?

I have a script calling several other scripts.
I wish to be able to catch an error that occurs in one
script using a try block surrounding the run script command
in the calling routine.

i.e.

(*   script A *)
property me_defined_error : -9999
property scriptB : "Script B.scpt"

try
	run script alias scriptB
on error error_message number error_number
	if error_number = my_defined_error then
		------  handle my error  ------
	end if
end try

If Script B has an error I need to trap, I want to return error number -9999.
But I don't know if -9999 is already a defined error number.


The AppleScript Users Guide documents several common error
numbers for both AS and the system but is, by no means, complete.
How does one go about finding available unused numbers?
Using -128 is way too generic.

TIA, Jim

_______________________________________________
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
  • Follow-Ups:
    • Re: user defined error number(s)
      • From: Philip Aker <email@hidden>
    • Re: user defined error number(s)
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: On My Mac
  • Next by Date: Re: user defined error number(s)
  • Previous by thread: How can I tell if server ftp folder upload is finished?
  • Next by thread: Re: user defined error number(s)
  • Index(es):
    • Date
    • Thread