[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 6 Jun 2019 15:44:58 -0300
> What happens when closing methods error?
>
> [...]
>
> I think the expected behavior would be:
>
> 1. attempt to execute all the closing methods (as Lua-5.4.0 does now),
> but report _the first encountered error_, instead of the last (in this
> example, reporting the assert failure)
>
> 2. include by default a traceback for the reported error even if there
> are more than one closing errors
The current behavior is to report the last error. This actually masks
the original error, which might be the cause for the other errors.
Besides, because these extra errors are run in a different environment
(because the first error exited the original one), they have no traceback.
We will change that to report the original error, which naturally
has the traceback.
-- Roberto