Trapping errors when a stack opens

Mark Wieder mwieder at ahsoftware.net
Mon Jul 28 00:33:10 EDT 2014


Pete-

Sunday, July 27, 2014, 8:28:26 PM, you wrote:

> Hi Mark,
> Not quite my situation.  The try/catch isn't in the preOpenxxx Handler
> which has the error, it's in the script of the stack that issues the open
> stack command.

Ah. Then the scripts are acting the way they're supposed to.
You have a runtime error in the preopenstack handler, the exception
was caught by the calling procedure. You're done with the preopenstack
handler because there's a runtime error in it. If you want to continue
you need to have the actual error statement in a try/catch construct.
You should have no problem continuing the script of the stack the
issues the open stack command, but you can't continue the called stack
the way you have it set up.

on preopenstack
 try
   -- put the stuff with the runtime error here
 catch e
   -- if you want to deal with the error, do it here
 finally
   -- here's where the continuation code goes
 end try
 -- or you could put code here as well
end preopenstack

-- 
-Mark Wieder
 ahsoftware at gmail.com

This communication may be unlawfully collected and stored by the National 
Security Agency (NSA) in secret. The parties to this email do not 
consent to the retrieving or storing of this communication and any 
related metadata, as well as printing, copying, re-transmitting, 
disseminating, or otherwise using it. If you believe you have received 
this communication in error, please delete it immediately.





More information about the use-livecode mailing list