Generate better error messages

This commit is contained in:
Nate Bowman
2026-11-11 23:57:14 -05:00
parent 5a5c6e1d3a
commit 20d4f5bd6c
2 changed files with 18 additions and 2 deletions

View File

@@ -136,7 +136,12 @@ class Gameplay():
def _handle_actions(self):
for func, args in self.actions[self.world.current_time]:
func(*args)
try:
func(*args)
except Exception as e:
raise type(e)(
f'Error in {func.__name__}{args}'
f' at time {self.world.current_time}.') from e
del self.actions[self.world.current_time]