From bc80aa0be1269c91ef28964e0804d0c128097e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Boisselier?= Date: Sun, 28 Apr 2024 17:24:54 +0200 Subject: [PATCH] fixed error if CSV doesn't match the expected format --- src/graph_creators/graph_vibrations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/graph_creators/graph_vibrations.py b/src/graph_creators/graph_vibrations.py index c33b359..ff551ee 100644 --- a/src/graph_creators/graph_vibrations.py +++ b/src/graph_creators/graph_vibrations.py @@ -622,8 +622,12 @@ def extract_angle_and_speed(logname): if match: angle = match.group(1) speed = match.group(2) + else: + raise ValueError(f'File {logname} does not match expected format. Clean your /tmp folder and start again!') except AttributeError as err: - raise ValueError(f'File {logname} does not match expected format.') from err + raise ValueError( + f'File {logname} does not match expected format. Clean your /tmp folder and start again!' + ) from err return float(angle), float(speed)