Error handling (was Re: "nan" v. try-catch for arithmetic)

Peter Haworth pete at lcsql.com
Thu Jun 26 18:23:17 CEST 2014


On Thu, Jun 26, 2014 at 8:22 AM, Richard Gaskin <ambassador at fourthworld.com>
wrote:

> Is there a simple rule that would allow scripters to understand when
> try-catch is necessary and when the result should be checked instead?
>
> If not, should there be?
>
> Or perhaps better yet, could error handling be made uniform, maybe as part
> of the Open Language initiative?  If so, what would it look like?
>

Personally, I think error handling should be made uniform.  As you say,
sometimes try/catch is required, other times the result must be checked and
sometimes "it" must be checked.  Then there's the different ways errors are
reported by the database library commands.

Maybe there should a new variable - the error for example - which can be
used to report all error conditions.  Another approach might be the ability
to specify a error callback handler similar to the libURL commands.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>


More information about the use-livecode mailing list