Re: What Does Error Return ?
Re: What Does Error Return ?
- Subject: Re: What Does Error Return ?
- From: Emmanuel LEVY <email@hidden>
- Date: Sat, 14 Mar 2015 17:47:20 +0100
Totally seconded, we do this all the time.
We would have prefered not to have to, but that's the way it goes today.
Main caveat is: when you use copy-paste to duplicate a handler, don't forget to edit the "stack trace" line!
Best,
Emmanuel
On Mar 13, 2015, at 7:58 PM, Christopher Stone wrote:
> On Mar 13, 2015, at 13:33, Luther Fuller <email@hidden> wrote:
>> I am trying to identify errors encountered by USERS of a completed product.
> ______________________________________________________________________
>
> Hey Luther,
>
> Right.
>
> Every handler needs it's on try block and needs to identify itself. That's not difficult to do or to read.
>
> Multiple handler calls need only need to be in one large try block that handles the ultimate report.
>
> on myErrorA()
> try
> myErrorB()
> on error e
> error "Error in handler myErrorA()" & return & return & e
> end try
> end myErrorA
>
> on myErrorB()
> try
> 1 / 0
> on error e
> error "Error in handler myErrorB()" & return & return & e
> end try
> end myErrorB
>
> try
>
> myErrorA()
>
> on error e number n
> e & return & return & n
> end try
>
> --> "Error in handler myErrorA()
>
> Error in handler myErrorB()
>
> Can’t divide 1.0 by zero.
>
> -2700"
>
> While this not ideal it does give you a rudimentary stack trace which is much better than nothing.
>
> It is not very cumbersome to employ.
>
> --
> Best Regards,
> Chris
>
> _______________________________________________
> 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
_______________________________________________
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