• 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: Error trapping
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error trapping


  • Subject: Re: Error trapping
  • From: Emmanuel <email@hidden>
  • Date: Sat, 25 Jan 2003 17:06:27 +0100

At 1:25 PM -0600 24/01/03, Amir Bozorgzadeh wrote:
I need to create an error trap for mounting an alias of a shared network volume on OS9. I am not real familiar with error trapping and what is happening is the alias to the server sometimes won't mount (cannot find on network) and I need it to reboot after this error so it can "re-find" the share. Thanks for any help.

You've got to encapsulate your script within an error handler:

try
-- lines that should connect to the shared volume
on error theErrorString number theErrorNumber
-- test what kind of error the script made
-- and take steps accordingly
end

To detect the particular error that you say ("cannot find on network"), the safest is to find out what its error number is. For that, the surest way is to run once the script in such a context that the error is triggered, and to have the error number displayed:

try
-- lines that should connect to the shared volume
on error theErrorString number theErrorNumber
display dialog ("Please note the error number: " & theErrorNumber) buttons {"Thanks!"}
end

HTH
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Error trapping (From: Amir Bozorgzadeh <email@hidden>)

  • Prev by Date: Re: structured data storage?
  • Next by Date: Re: structured data storage?
  • Previous by thread: Error trapping
  • Next by thread: Truncating phantom characters
  • Index(es):
    • Date
    • Thread