Generate better error messages
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user