[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Does anyone have "assert" blindness ?
- From: Axel Kittenberger <axkibe@...>
- Date: Wed, 9 Mar 2011 20:54:34 +0100
> I'd love to hear any/everyone's thoughts about this issue: Would you
> rather see a Lua module raising errors or returning (nil, msg)? Or is
> there a better solution that I haven't considered?
I suppose the proper Lua style *is* returning nil, msg and having a
lot of asserts on the caller who cares. Don't see a good way around
that.
I know nowadays java is totally uncool, but I did like the way it did
with Exceptions. That is having some typed error that is catched by
the instance who knows how to handle it (and others passed through).
Or writing first a code block simply without worrying about errors and
then a handler block to propely handle all kind of different
exceptions.