From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id DA5926FC82; Fri, 12 Nov 2021 09:31:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DA5926FC82 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1636698708; bh=6M8M1m9M3f0Ist9+lOhhcT+kjHjdjcUTANPPEvKOQkY=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NXdieebnnRGvSyU9XldXgnpljyXb6cTusaoFEMMTp4/xEQ7dVSsbPT0qaHS68uZt1 hg56/ava7EItiakVV8/Qi+7mWcfnYLu+B0su2xETqe3ZzVy2kYAq7v8M2oVnWRVgNO e/rDQaBkT5SDdYVphD676EIYdWsNfBocwOcyrZRc= Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (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 00A7E6FC82 for ; Fri, 12 Nov 2021 09:31:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 00A7E6FC82 Received: by smtp34.i.mail.ru with esmtpa (envelope-from ) id 1mlQ6C-0003pw-Ur; Fri, 12 Nov 2021 09:31:45 +0300 Message-ID: Date: Fri, 12 Nov 2021 09:31:44 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Content-Language: ru To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, vdavydov@tarantool.org References: <375c2c4037f0517fa0801a752266530151544329.1636156453.git.v.shpilevoy@tarantool.org> <7b58d78b-2a74-71c3-6bd1-094746c73010@tarantool.org> <8de32cc0-1c9b-7fd5-2343-ff72567c43ba@tarantool.org> In-Reply-To: <8de32cc0-1c9b-7fd5-2343-ff72567c43ba@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9731B3922EC063979787B19701143D42A39EF849E3128968B00894C459B0CD1B9162AD7A1F0D4817F0EED7D41E453C174B22E602945078FB147030CE06FC90E99 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78E8764B5BC580342EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B3D52627AD81B52CEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F24F032AD4B7FBC2CEFA5B2B1E17081D23CC7F00164DA146DAFE8445B8C89999728AA50765F7900637DCE3DBD6F8E38AFD389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2DCF9CF1F528DBCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CA0BCD6C998BE2772302FCEF25BFAB3454AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C3C30C415A873EAD8ABA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE72F88032165008D51731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B5057ABAA89EDCD96AF9B4A67F492FB27CE3 X-C1DE0DAB: 0D63561A33F958A559344F3A9AB6D4EA0D55DE922BDA79CC27CE7C291EA8AB1AD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7536C62C4FBC402878410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34197948450CB5442AA8BB5953A7AAA8692F1F07BEE14AD6402021713906A0181A8ED547C70D2C0A851D7E09C32AA3244CB8A3CF0E0A5038B294D21F2644E744023A76366E8A9DE7CAFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj4t8MBgWr8bIbxj1bHKyudA== X-Mailru-Sender: 11C2EC085EDE56FA38FD4C59F7EFE407308BB26E45FFC32FCC035F8A3F86C8BE8F465D15A528579A6BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 3/9] error: move code to struct error from ClientError X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 12.11.2021 02:50, Vladislav Shpilevoy пишет: > Thanks for the review! > >>> diff --git a/src/lua/error.lua b/src/lua/error.lua >>> index ebc784f07..9fb227df4 100644 >>> --- a/src/lua/error.lua >>> +++ b/src/lua/error.lua >>> @@ -18,6 +18,7 @@ struct error { >>>       const struct type_info *_type; >>>       int64_t _refs; >>>       int _saved_errno; >>> +    int code; >> 1. All the other fields are prefixed with "_" for some reason. >>    Let's do the same for "code", just to comply. > I named it without '_' intentionally. Because then Lua will see > this field right away when you do `err.code`. That also allows > me not to define a getter in `error_fields` table. > >>>       /** Line number. */ >>>       unsigned _line; >>>       /* Source file name. */ >>> @@ -158,7 +159,7 @@ local function error_unpack(err) >>>       if not ffi.istype('struct error', err) then >>>           error("Usage: error:unpack()") >>>       end >>> -    local result = {} >>> +    local result = {code = err.code} >> 2. Why not add 'code' to 'error_fields' ? > Because it is visible without a getter anyway. On the downside, here > in unpack() I need to add it explicitly. Ok. Thanks for the explanation! -- Serge Petrenko