On Wednesday, Aug 25 1999, Dave Cragg wrote:

> Hi
> 
> I'd be interested in some more discussion of error handling strategies.
>
> One thing that's not clear to me is the types of error that are
> "thrown" by Metacard in a try-catch structure. For example, script
> errors are thrown, but file related errors aren't. For this we have
> to check "the result". But what about memory-related errors? Is there
> a list anywhere of the errors that Metacard throws?

Yes:

put fld "messages" of stack "execution error"

Note that these change from release to release, so never rely on a
particular error to be found in a specific place in the list.

> Recently, I started using something like the following for
> file-related errors ...
>
> try
>    put url someUrl into tVar
>    if the result is not empty then throw the result
>    --more stuff here
> catch pError
>    put "There was an error" && pError -- for example
> end try
>
> .. but I'd be interested to know how other people handle this kind of thing.

That looks like a good way to do it to me.

> And what is the purpose of the "finally" structure?

That gets executed regardless of whether or not catch has caught an error or
not.  I'm not sure why its there though - seems to me that you could put
whatever statements you want to execute either way after "end try" - like
"end if".

Regards,

Kevin

> Still thirsting for knowledge.
> Dave Cragg

Kevin Miller <[EMAIL PROTECTED]> <http://www.xworlds.com/>
Cross Worlds Computing, MetaCard Distributors, Custom Development.
Tel: +44 (0)131 672 2909.  Fax: +44 (0)1639 830 707.

Reply via email to