From a4c29aaa9e94257de72ba7289249543cb24a2ba0 Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Wed, 18 Sep 2024 14:33:10 +0200 Subject: [PATCH] Disk is often missing. Making guard clause for now --- api/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/main.py b/api/main.py index a659e630f..988554ace 100644 --- a/api/main.py +++ b/api/main.py @@ -678,7 +678,8 @@ async def hog_add(measurements: List[HogMeasurement]): try: _ = Measurement(**measurement_data) except (ValidationError, RequestValidationError) as exc: - error_helpers.log_error('Caught Exception in Measurement(), but not critical', exception_class=exc.__class__.__name__, exception=exc) + if len(exc.errors()) != 1 or exc.errors()['loc'] != ('disk',): + error_helpers.log_error('Caught Exception in Measurement(), but not critical', exception_class=exc.__class__.__name__, exception=exc) # Output is extremely verbose. Please only turn on if debugging manually # print(f"Errors are: {exc.errors()}")