[Tarantool-patches] [PATCH 2/7] box/error: introduce box.error.set() method

Cyrill Gorcunov gorcunov at gmail.com
Wed Feb 19 17:26:27 MSK 2020


On Wed, Feb 19, 2020 at 05:16:51PM +0300, Nikita Pettik wrote:
> +static int
> +luaT_error_set(lua_State *L)
> +{
> +	if (lua_gettop(L) == 0)
> +		return luaL_error(L, "Usage: box.error.set(error)");
> +	struct error *e = luaL_checkerror(L, 1);
> +	assert(e != NULL);
> +	diag_set_error(&fiber()->diag, e);
> +	return 0;
> +}

diag_set_error already has assert(e != NULL), maybe we could omit this one?


More information about the Tarantool-patches mailing list