Release Notes: CalibratorTransformer Error Handling Update
🚀 Improvements
- Graceful Error Handling: Removed hard exits (
sys.exit or implicit crashes) from the _parse_frequency_response method.
- Explicit Exceptions: The class now explicitly raises
ValueError (for invalid data/formats) or FileNotFoundError when parsing calibration files fails.
- Logging Adjustments: Downgraded log levels for parsing failures from
CRITICAL to ERROR, reflecting that these are now recoverable exceptions rather than system-terminating events.
⚠️ Breaking Changes
- Exception Handling Required: Consumer code instantiating
CalibratorTransformer should now wrap the initialization in a try/except block to catch ValueError or FileNotFoundError if robust error recovery is desired.
Example Usage
try:
transformer = CalibratorTransformer(file_path, ...)
except (ValueError, FileNotFoundError) as e:
logger.error(f"Calibration failed: {e}")
# Fallback logic here