[Tarantool-patches] [PATCH v5 8/8] refactoring: remove try..catch wrapper around trigger->run

Sergey Ostanevich sergos at tarantool.org
Wed Nov 27 18:01:46 MSK 2019


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
> 


More information about the Tarantool-patches mailing list