lua-users home
lua-l archive

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


Hi,

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
5.0.2.

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.

Regards,
Diego.