fix: add error logging to simulate engine to prevent silent failures #38

Merged
shoko merged 1 commits from fix/issue-30 into main 2026-04-09 12:19:36 +02:00
Owner

Summary

  • Add logging import and logger instance to simulate/engine.py
  • Replace silent pass with logger.warning() and append to errors list
  • Include total_errors count and errors array in simulation results
  • Simulation continues even if price fetches fail (graceful degradation)

Changes

  1. Added import logging and logger = logging.getLogger(name)
  2. Added self.errors: List[str] = [] to track errors
  3. Changed except Exception as e: pass to log warning and track error
  4. Added total_errors and errors to results dictionary

Acceptance Criteria

  • Errors are logged (not silently swallowed)
  • User can see error count/warnings in simulation results
  • Simulation completes even if some price fetches fail (graceful degradation)

Fixes #30

## Summary - Add logging import and logger instance to simulate/engine.py - Replace silent pass with logger.warning() and append to errors list - Include total_errors count and errors array in simulation results - Simulation continues even if price fetches fail (graceful degradation) ## Changes 1. Added import logging and logger = logging.getLogger(__name__) 2. Added self.errors: List[str] = [] to track errors 3. Changed except Exception as e: pass to log warning and track error 4. Added total_errors and errors to results dictionary ## Acceptance Criteria - [x] Errors are logged (not silently swallowed) - [x] User can see error count/warnings in simulation results - [x] Simulation completes even if some price fetches fail (graceful degradation) Fixes #30
shoko added 1 commit 2026-04-09 12:17:27 +02:00
Errors during price fetching are now logged and stored in an errors list,
allowing users to see error count/warnings in simulation results.

Acceptance Criteria:
- [x] Errors are logged (not silently swallowed)
- [x] User can see error count/warnings in simulation results
- [x] Simulation completes even if some price fetches fail (graceful degradation)
han approved these changes 2026-04-09 12:19:06 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit ac5e9d8b81 into main 2026-04-09 12:19:36 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#38