From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EFBEC469719 for ; Wed, 19 Feb 2020 17:30:51 +0300 (MSK) Date: Wed, 19 Feb 2020 17:30:51 +0300 From: Nikita Pettik Message-ID: <20200219143051.GA40100@tarantool.org> References: <0eca2c9457d95dbef38556d738f1e5818468a175.1582119629.git.korablev@tarantool.org> <20200219142627.GA2788@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200219142627.GA2788@uranus> Subject: Re: [Tarantool-patches] [PATCH 2/7] box/error: introduce box.error.set() method List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org 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.