Skip to content

Commit bbb63c6

Browse files
committed
fix: add csv.Error to _load_estimates_from_csv exception handling
Malformed CSV files (NUL bytes, parser corruption) would bubble up and crash startup instead of logging a warning and continuing without estimates. Restores graceful degradation for this optional input path.
1 parent 2c175a1 commit bbb63c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/data_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def _load_estimates_from_csv(csv_path: Path) -> bool:
496496
if count:
497497
logger.info("Loaded %d estimates from %s", count, csv_path)
498498
return count > 0
499-
except (OSError, KeyError, ValueError) as exc:
499+
except (OSError, KeyError, ValueError, csv.Error) as exc:
500500
logger.warning("Failed to load estimates from CSV: %s", exc)
501501
return False
502502

0 commit comments

Comments
 (0)