[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Try-catch and try-finally
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 31 May 2016 14:41:13 +0200
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