fix: log failure reason before COMPLETE and fix misleading SCRAPE β (#1949)#1952
Open
hafezparast wants to merge 1 commit intounclecode:developfrom
Open
fix: log failure reason before COMPLETE and fix misleading SCRAPE β (#1949)#1952hafezparast wants to merge 1 commit intounclecode:developfrom
hafezparast wants to merge 1 commit intounclecode:developfrom
Conversation
β¦nclecode#1949) Two issues caused silent COMPLETE β with no diagnostic output: 1. When crawl_result.success=False (anti-bot detection, empty HTML, etc.), the error_message was set on the CrawlResult but never logged β users saw only [COMPLETE] β with zero explanation. Fix: emit an [ERROR] log containing error_message before the COMPLETE line whenever success=False. 2. The SCRAPE log in aprocess_html always emitted success=True regardless of whether scraping produced any content. Fix: use bool(cleaned_html) so SCRAPE reflects the actual outcome. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a crawl fails (anti-bot detection, empty HTML, etc.), users see only
[COMPLETE] βwith zero explanation β even withverbose=True. TheCrawlResult.error_messageis correctly set but was never logged to the console.A second issue: the
[SCRAPE]log always emittedβregardless of whether scraping produced any content, which was actively misleading.Before:
After:
Fix
Two-line change in
async_webcrawler.py:crawl_result.success=Falseanderror_messageis set, emit an[ERROR]log with the reasonaprocess_html: change SCRAPE log from hardcodedsuccess=Truetosuccess=bool(cleaned_html)Test plan
Fixes #1949
π€ Generated with Claude Code