From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BE676469719 for ; Wed, 19 Feb 2020 17:26:29 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id y6so600824lji.0 for ; Wed, 19 Feb 2020 06:26:29 -0800 (PST) Date: Wed, 19 Feb 2020 17:26:27 +0300 From: Cyrill Gorcunov Message-ID: <20200219142627.GA2788@uranus> References: <0eca2c9457d95dbef38556d738f1e5818468a175.1582119629.git.korablev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0eca2c9457d95dbef38556d738f1e5818468a175.1582119629.git.korablev@tarantool.org> 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: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org 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?