From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 04783294C5 for ; Fri, 30 Aug 2019 08:59:10 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TxnCUMZrzaE7 for ; Fri, 30 Aug 2019 08:59:09 -0400 (EDT) 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 turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 483C3294C3 for ; Fri, 30 Aug 2019 08:59:09 -0400 (EDT) Date: Fri, 30 Aug 2019 15:58:51 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH v2 1/3] box: rfc for stacked diagnostic area in Tarantool Message-ID: <20190830125851.fjw5wgvchuwsens6@tkn_work_nb> References: <7b663975f0307541a6751bde10547fc2c13b5679.1566553968.git.kshcherbatov@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7b663975f0307541a6751bde10547fc2c13b5679.1566553968.git.kshcherbatov@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Kirill Shcherbatov Cc: tarantool-patches@freelists.org, georgy@tarantool.org, kostja@tarantool.org > +### Lua API > +Tarantool returns a last-set (diag::last) error object as `cdata` from central diagnostic > +area to Lua in case of error. User shouldn't have an ability to modify it > +(because he actually needn't and because it is dangerous - he doesn't own this object), > +but it need an ability to inspect a collected diagnostics information. > + > +Let's extend the `box.error` API with a couple of new functions: > +1) `prev` that allows to get a reason of given error: > + > +``` > +-- Return a reason error object for given error > +-- (when exists, nil otherwise) > +box.error.prev(error) > +``` I would also add err:prev() method like we did for, say, box.tuple.update(t, <...>) and t:update(<...>).