• 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
Re: Throwing Errors in Functions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Throwing Errors in Functions?


  • Subject: Re: Throwing Errors in Functions?
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 11 Mar 2015 12:46:31 -0500

On Mar 11, 2015, at 12:20 PM, Stockly, Ed wrote:


On a related note, how would I force the script to stop executing if a function errors out? I've tried exit, but that's only for loops; and quit, but that somehow closed Script Editor.

You can use the return command to exit out of a handler, or your script if it's in the run or open hander.

Yes, but that just returns you to the point in your script that called the handler.
Now, what do you do ?????????
That's why it's best to use
error number -128
or
error "Explain to the user why continuation was not possible." -- returns error number -2700
using the run handler I presented.




 _______________________________________________
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

References: 
 >Throwing Errors in Functions? (From: Alex Hall <email@hidden>)
 >Re: Throwing Errors in Functions? (From: Shane Stanley <email@hidden>)
 >Re: Throwing Errors in Functions? (From: Alex Hall <email@hidden>)
 >Re: Throwing Errors in Functions? (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: Throwing Errors in Functions?
  • Next by Date: Resource for Cocoa Object Syntax in AS?
  • Previous by thread: Re: Throwing Errors in Functions?
  • Next by thread: Re: Throwing Errors in Functions?
  • Index(es):
    • Date
    • Thread