lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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.