Pure Lua equivalent of lua-try (https://github.com/moteus/lua-try)