[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaSocket Finalized Exceptions: protect won't work with assert
- From: Diego Nehab <diego@...>
- Date: Tue, 13 Sep 2005 00:13:01 -0400 (EDT)
The LuaSocket docs indicate that socket.protect can be used to
generate a safe function from another function that throws exceptions.
The docs tell me I can protect any function that "is a function that
calls try (or assert, or error) to throw exceptions". I'm missing
something because I can't get it to work with assert. I'm using Lua
My bad, I forgot to update the documentation. It used to work with
assert and error, but that made "protect" turn unrelated errors into
return values, which in turn made it very hard to debug our programs.
Someone suggested that it would be better if only errors thrown by "try"
were caught and I made the change.
Will fix the manual.