From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (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 AE3D64696C6 for ; Fri, 22 Nov 2019 05:47:17 +0300 (MSK) From: Ilya Kosarev Date: Fri, 22 Nov 2019 05:46:56 +0300 Message-Id: <9e4dba1fbf7d9c3809666da1770f2b4699255da1.1574390065.git.i.kosarev@tarantool.org> In-Reply-To: References: In-Reply-To: References: Subject: [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: tarantool-patches@dev.tarantool.org 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