[tarantool-patches] [PATCH v4 20/20] refactoring: remove try..catch wrapper around trigger->run

Ilya Kosarev i.kosarev at tarantool.org
Mon Sep 23 18:57:11 MSK 2019


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





More information about the Tarantool-patches mailing list