fix: broaden _log_portfolio exception catch to handle all failures
OSError only covers file I/O errors; json.dump can also raise TypeError on non-serializable data. Use Exception to ensure logging failures never discard analysis results. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3abff48c7d
commit
2ce7e2b6d0
|
|
@ -63,7 +63,7 @@ class PortfolioAnalyzer:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._log_portfolio(trade_date, tickers, individual_results, portfolio_summary)
|
self._log_portfolio(trade_date, tickers, individual_results, portfolio_summary)
|
||||||
except OSError as e:
|
except Exception as e:
|
||||||
if debug:
|
if debug:
|
||||||
print(f"Warning: failed to save portfolio log: {e}")
|
print(f"Warning: failed to save portfolio log: {e}")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue