lua-users home
lua-l archive

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


On Tue, May 31, 2016 at 2:34 PM, Peter Melnichenko <mpeterval@gmail.com> wrote:
> (Sorry, as expected, this thread becomes the usual "errors vs,
> exception" debate)

Oh it's very relevant! And error handling at source (so goes the
story) messes with the 'happy path' and obscures program logic. But
error handling is unavoidable, we all know that.  The example would
probably more look like this, after ensuring that the returned error
might make more sense to the caller (hence the jab at Java)

    local result, err = func()
    if not result then return nil, 'unable to invoke func in reader' end