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

Nikita Pettik korablev at tarantool.org
Wed Feb 19 17:30:51 MSK 2020


On 19 Feb 17:26, Cyrill Gorcunov wrote:
> 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?

Yep, you are right, this assertion is likely to be redundant. Thanks,
will drop it while preparing next patch-set version.



More information about the Tarantool-patches mailing list