diff --git a/jaseci_core/jaseci/jac/interpreter/interp.py b/jaseci_core/jaseci/jac/interpreter/interp.py index 03c101c5ae..b9fd210f20 100644 --- a/jaseci_core/jaseci/jac/interpreter/interp.py +++ b/jaseci_core/jaseci/jac/interpreter/interp.py @@ -156,13 +156,15 @@ def run_try_stmt(self, jac_ast): self._jac_try_mode += 1 try: self.run_code_block(kid[1]) + self._jac_try_mode -= 1 except TryException as e: + self._jac_try_mode -= 1 if len(kid) > 2: self.run_else_from_try(kid[2], e.ref) except Exception as e: + self._jac_try_mode -= 1 if len(kid) > 2: self.run_else_from_try(kid[2], self.jac_exception(e, kid[2])) - self._jac_try_mode -= 1 def run_else_from_try(self, jac_ast, jac_ex): """ diff --git a/jaseci_core/jaseci/prim/ability.py b/jaseci_core/jaseci/prim/ability.py index d785753d24..9981ee71c1 100644 --- a/jaseci_core/jaseci/prim/ability.py +++ b/jaseci_core/jaseci/prim/ability.py @@ -66,22 +66,17 @@ def run_action(self, param_list, scope, interp, jac_ast): action_manager.pre_action_call_hook() ts = time.time() - if "meta" in args: - result = func( - *param_list["args"], - **param_list["kwargs"], - meta={ + try: + if "meta" in args: + param_list["kwargs"]["meta"] = { "m_id": scope.parent._m_id, "h": scope.parent._h, "scope": scope, "interp": interp, - }, - ) - else: - try: - result = func(*param_list["args"], **param_list["kwargs"]) - except Exception as e: - interp.rt_error(e, jac_ast, True) + } + result = func(*param_list["args"], **param_list["kwargs"]) + except Exception as e: + interp.rt_error(e, jac_ast, True) t = time.time() - ts action_manager.post_action_call_hook(action_name, t) return result