From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (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 8769046970F for ; Wed, 27 Nov 2019 18:01:47 +0300 (MSK) Date: Wed, 27 Nov 2019 18:01:46 +0300 From: Sergey Ostanevich Message-ID: <20191127150146.GH1718@tarantool.org> References: <9e4dba1fbf7d9c3809666da1770f2b4699255da1.1574390065.git.i.kosarev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9e4dba1fbf7d9c3809666da1770f2b4699255da1.1574390065.git.i.kosarev@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v5 8/8] refactoring: remove try..catch wrapper around trigger->run List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ilya Kosarev Cc: tarantool-patches@dev.tarantool.org Hi! LGTM, thank you for the whole set! Sergos On 22 Nov 05:46, Ilya Kosarev wrote: > Triggers don't throw exceptions any more. Now they have > return codes to report errors. > > Closes #4247 > --- > src/lib/core/trigger.cc | 25 ++++++++----------------- > 1 file changed, 8 insertions(+), 17 deletions(-) > > diff --git a/src/lib/core/trigger.cc b/src/lib/core/trigger.cc > index 8f6a83fb5..7fe112f8b 100644 > --- a/src/lib/core/trigger.cc > +++ b/src/lib/core/trigger.cc > @@ -30,32 +30,23 @@ > */ > > #include "trigger.h" > -#include "exception.h" > > int > trigger_run(struct rlist *list, void *event) > { > - try { > - struct trigger *trigger, *tmp; > - rlist_foreach_entry_safe(trigger, list, link, tmp) > - if (trigger->run(trigger, event) != 0) > - return -1; > - } catch (Exception *e) { > - return -1; > - } > + struct trigger *trigger, *tmp; > + rlist_foreach_entry_safe(trigger, list, link, tmp) > + if (trigger->run(trigger, event) != 0) > + return -1; > return 0; > } > > int > trigger_run_reverse(struct rlist *list, void *event) > { > - try { > - struct trigger *trigger, *tmp; > - rlist_foreach_entry_safe_reverse(trigger, list, link, tmp) > - if (trigger->run(trigger, event) != 0) > - return -1; > - } catch (Exception *e) { > - return -1; > - } > + struct trigger *trigger, *tmp; > + rlist_foreach_entry_safe_reverse(trigger, list, link, tmp) > + if (trigger->run(trigger, event) != 0) > + return -1; > return 0; > } > -- > 2.17.1 >