fix: replace bare raise with return False in _restore_from_checkpoint

When _checkpoint_system_enabled is False, the method uses a bare
`raise` with no active exception, which causes RuntimeError at
runtime. The method's docstring says it returns False when restoration
is not possible, so return False is the correct behavior.

The caller in crawl() currently guards with `if
self._checkpoint_system_enabled`, but the method's own contract
should be self-consistent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
haosenwang1018
2026-03-15 17:52:57 +08:00
parent c7f0db912c
commit a31763afde
+1 -1
View File
@@ -205,7 +205,7 @@ class CrawlerEngine:
Returns True if successfully restored, False otherwise.
"""
if not self._checkpoint_system_enabled:
raise
return False
data = await self._checkpoint_manager.load()
if data is None: