From a31763afdeaec2f4cfd4b402e81692cd301b4c0a Mon Sep 17 00:00:00 2001 From: haosenwang1018 <1293965075@qq.com> Date: Sun, 15 Mar 2026 17:52:57 +0800 Subject: [PATCH] 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) --- scrapling/spiders/engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapling/spiders/engine.py b/scrapling/spiders/engine.py index 416911d..d77f838 100644 --- a/scrapling/spiders/engine.py +++ b/scrapling/spiders/engine.py @@ -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: