• 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: Buttons with Display Dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buttons with Display Dialog


  • Subject: Re: Buttons with Display Dialog
  • From: Emmanuel <email@hidden>
  • Date: Mon, 3 Dec 2007 15:19:22 +0100

At 2:35 PM +0100 12/3/07, Skeeve wrote:
Emmanuel wrote:
Far from the topic, but this does not make a very good error display, as you don't get something very meaningful when you append " occurred" to an error message, look:

File "Macintosh HD:bah" was not found. occurred

or

Can't divide 1.0 by zero. occurred

;-) Is that bad english? I'm German. Just kidding. No. I'm really German. Just kidding about the question.


Of course you are right. So what would be a good alternative?

return "An error occurred!" & return & "The message was: " & errtxt

Why not, or even better you can display the handler's name to help debug:

return "An error occurred in DoTheNiceJob: " & errtxt

Emmanuel

PS
One of our programmers installs a message display in the "top" handler, and in the other handlers he propagates the error after pre-pending the handler's name:



on error errtxt error "ThisHandlerName: " & errtxt end

So, the error message displays the full sequence of handlers, that's very helpful sometimes. If handlerA calls handlerB who calls handlerC which triggers an error, he gets:

handlerA: handlerB: handlerC: file not found etc
_______________________________________________
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: Buttons with Display Dialog
      • From: Wayne Melrose <email@hidden>
References: 
 >Buttons with Display Dialog (From: Kevin Ballon <email@hidden>)
 >Re: Buttons with Display Dialog (From: Peter Baxter <email@hidden>)
 >Re: Buttons with Display Dialog (From: Skeeve <email@hidden>)
 >Re: Buttons with Display Dialog (From: Emmanuel <email@hidden>)
 >Re: Buttons with Display Dialog (From: Skeeve <email@hidden>)

  • Prev by Date: Re: Buttons with Display Dialog
  • Next by Date: Re: Buttons with Display Dialog
  • Previous by thread: Re: Buttons with Display Dialog
  • Next by thread: Re: Buttons with Display Dialog
  • Index(es):
    • Date
    • Thread