Skip to content

Commit

Permalink
Fixed try-except
Browse files Browse the repository at this point in the history
  • Loading branch information
alvalentini committed Jan 15, 2024
1 parent 72037f4 commit 2567ee5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions unified_planning/engines/plan_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,12 @@ def _validate(
if unsat_conds:
assert reason == InapplicabilityReasons.VIOLATES_CONDITIONS
msg = f"Preconditions {unsat_conds} of {str(i)}-th action instance {str(ai)} are not satisfied."
else:
next_state = simulator.apply_unsafe(trace[-1], ai)
except UPUsageError as e:
msg = f"{str(i)}-th action instance {str(ai)} creates a UsageError: {str(e)}"
except UPInvalidActionError as e:
msg = f"{str(i)}-th action instance {str(ai)} creates an Invalid Action: {str(e)}"
try:
next_state = simulator.apply_unsafe(trace[-1], ai)
except UPInvalidActionError as e:
msg = f"{str(i)}-th action instance {str(ai)} creates an Invalid Action: {str(e)}"
except UPConflictingEffectsException as e:
msg = f"{str(i)}-th action instance {str(ai)} creates Conflicting Effects: {str(e)}"
if msg is not None:
Expand Down

0 comments on commit 2567ee5

Please sign in to comment.