Re: Buttons with Display Dialog
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