Skip to content

Commit

Permalink
Disk is often missing. Making guard clause for now
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneTR committed Sep 18, 2024
1 parent e035dba commit a4c29aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}")

Expand Down

0 comments on commit a4c29aa

Please sign in to comment.