From d671c4d8f66f5a19f640cc42175a4365771dd621 Mon Sep 17 00:00:00 2001 From: Matteo Bettini Date: Fri, 22 Sep 2023 11:40:42 +0100 Subject: [PATCH] [Fix] Gracefully close in case of error Signed-off-by: Matteo Bettini --- benchmarl/experiment/experiment.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/benchmarl/experiment/experiment.py b/benchmarl/experiment/experiment.py index 8e24d8b5..48a090ca 100644 --- a/benchmarl/experiment/experiment.py +++ b/benchmarl/experiment/experiment.py @@ -317,7 +317,11 @@ def _setup_logger(self): ) def run(self): - self._collection_loop() + try: + self._collection_loop() + except Exception as err: + self.close() + raise err def _collection_loop(self):