Skip to content

Commit

Permalink
better trace for run errors
Browse files Browse the repository at this point in the history
  • Loading branch information
FilippoAiraldi committed Feb 9, 2024
1 parent 40ff8af commit dba5c0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benchmarking/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from itertools import chain, cycle, product
from pathlib import Path
from time import perf_counter
from traceback import format_exc
from typing import Optional, Union
from warnings import filterwarnings, warn

Expand Down Expand Up @@ -262,9 +263,9 @@ def next_obs(
bests = ",".join(map(str, bests))
timings = ",".join(map(str, timings))
lock_write(csv, f"{problem_name};{method};{rewards};{bests};{timings}")
except Exception as e:
except Exception:
warn(
f"Exception raised during `{problem_name}` with `{method}`:\n{e}.",
f"Exception raised in `{problem_name}`, `{method}`:\n{format_exc()}",
RuntimeWarning,
)
finally:
Expand Down

0 comments on commit dba5c0f

Please sign in to comment.