Skip to content

Commit

Permalink
[ERROR-HANDLING]: Add subtle error for non existing architype
Browse files Browse the repository at this point in the history
  • Loading branch information
amadolid committed Jul 25, 2023
1 parent 2af3f21 commit 5acb2e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions jaseci_core/jaseci/jac/machine/machine_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ def rt_warn(self, error, jac_ast=None):
error = self.rt_log_str(error, jac_ast)
logger.warning(str(error))

def rt_subtle_error(self, error, jac_ast=None):
error = self.rt_log_str(error, jac_ast)
logger.error(str(error))
self.runtime_errors.append(error)

def rt_error(self, error, jac_ast, append=False):
"""Prints runtime error to screen"""

Expand Down
2 changes: 1 addition & 1 deletion jaseci_core/jaseci/prim/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_arch_for(self, obj):
"""Returns the architype that matches object"""
ret = self.arch_ids.get_obj_by_name(name=obj.name, kind=obj.kind)
if ret is None:
self.rt_error(
self.rt_subtle_error(
f"Unable to find architype for {obj.name}, {obj.kind}",
self._cur_jac_ast,
)
Expand Down

0 comments on commit 5acb2e6

Please sign in to comment.