2
0
mirror of https://github.com/boostorg/leaf.git synced 2026-02-22 15:32:24 +00:00

is_error_type, renamed peek_next_error to next_error_value

This commit is contained in:
Emil Dotchevski
2018-11-25 12:37:27 -08:00
parent bb54d9d19d
commit 1bac1e1d1a
16 changed files with 204 additions and 48 deletions

View File

@@ -23,6 +23,9 @@ enum do_work_error_code
ec1=1,
ec2
};
namespace boost { namespace leaf {
template<> struct is_error_type<do_work_error_code>: std::true_type { };
} }
struct e_lua_pcall_error { int value; };
struct e_lua_error_message { std::string value; };
@@ -46,7 +49,7 @@ int do_work( lua_State * L ) noexcept
{
//Associate an do_work_error_code object with the *next* leaf::error object we will
//definitely return from the call_lua function...
leaf::peek_next_error().propagate(ec1);
leaf::next_error_value().propagate(ec1);
//...once control reaches it, after we tell the Lua interpreter to abort the program.
return luaL_error(L,"do_work_error");