Hook for ignored errors?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Hook for ignored errors?

Andrew Gierth
The current 5.4 releases assume that the only useful thing that can be
done with an ignored error is to emit it as a warning if it is a string,
and emit a generic message otherwise.

Would it not make sense to provide for a more specific "I'm about to
ignore this error object" function that the environment can supply, that
allows any kind of value and not just strings?

--
Andrew.

Reply | Threaded
Open this post in threaded view
|

Re: Hook for ignored errors?

Paul K-2
> Would it not make sense to provide for a more specific "I'm about to
> ignore this error object" function that the environment can supply, that
> allows any kind of value and not just strings?

I'd be interested in this as well for trapping/reporting errors during
debugging.

I had a similar proposal
(http://lua-users.org/lists/lua-l/2014-03/msg00457.html) and Joshua
Jensen pointed to his error hook patch for Lua 5.1 as a possible
solution: https://github.com/jjensen/lua-tilde/blob/master/lib/lua/lua_5.1.3.patch

Paul.

On Fri, Jun 7, 2019 at 9:01 AM Andrew Gierth
<[hidden email]> wrote:

>
> The current 5.4 releases assume that the only useful thing that can be
> done with an ignored error is to emit it as a warning if it is a string,
> and emit a generic message otherwise.
>
> Would it not make sense to provide for a more specific "I'm about to
> ignore this error object" function that the environment can supply, that
> allows any kind of value and not just strings?
>
> --
> Andrew.
>