Skip to content

[WIP] Fix error/zubair ali#2761

Draft
ZubairAli999 wants to merge 4 commits into
soxoj:mainfrom
ZubairAli999:fix-error/Zubair-ali
Draft

[WIP] Fix error/zubair ali#2761
ZubairAli999 wants to merge 4 commits into
soxoj:mainfrom
ZubairAli999:fix-error/Zubair-ali

Conversation

@ZubairAli999

Copy link
Copy Markdown

PR (#2667)

tbs-zubair-ali and others added 3 commits June 11, 2026 12:31
Add richer error model and detection, tidy common error definitions, and improve notification logic in maigret/errors.py: introduce CheckError.context, implement detect() and solution_of(), simplify ERRORS_TYPES, add type hints, fix error grouping percentage calculation, and refine notify_about_errors formatting and thresholds. Update maigret/report.py to adjust imports, add an updated CSV export (new header and per-site fields including error reason and site URL), and enhance XMind sheet generation to include Errors/Undefined sections and preserve ids metadata for reported entries. Miscellaneous style/formatting cleanups across both files.
Remove obsolete/duplicated report code and add clarifying comments in errors.py. In report.py: deleted an old CSV writer block in generate_csv_report and a large duplicated XMind sheet construction block in design_xmind_sheet to reduce dead code and clutter. In errors.py: added comment headers around the threshold constant and the error analysis function to improve readability. No functional logic changes other than removing unused/duplicated report code.
The detect() function was returning CheckError for ANY non-empty text that
didn't match known patterns. This caused valid 200 responses to be incorrectly
marked as errors.

Changed behavior:
- Only return CheckError if a known error pattern is found
- Return None for normal/valid responses (including HTML bodies)

This fixes all 24 failing tests that were getting "Unrecognized error pattern"
for valid responses.
@ZubairAli999

Copy link
Copy Markdown
Author

PR (#2667 )

- Add comprehensive error solutions for Captcha, Bot protection, Access denied
- Add DNS-specific error handling with proper recommendations
- Add Webgate unavailable error handling with FlareSolverr instructions
- Add PROXY_RECOMMENDATION constant that was missing
- Fixes failing tests that expect complete error handling
@soxoj

soxoj commented Jun 11, 2026

Copy link
Copy Markdown
Owner

@ZubairAli999 please, fix the tests

@ZubairAli999

Copy link
Copy Markdown
Author

@soxoj Don’t worry, I can fix the problem. Please give me some time, I’m currently a bit busy with another project, but I’ll take care of it.

@soxoj soxoj changed the title Fix error/zubair ali [WIP] Fix error/zubair ali Jun 11, 2026
@ZubairAli999

Copy link
Copy Markdown
Author

@soxoj The issues in report.py and error.py are fixed and their code works fine.

The remaining test failures are unrelated:

  1. test_submit.py: Network failures reaching live sites.
  2. test_db_updater.py: Windows path mismatch (\ vs /).
  3. test_maigret.py & test_cloudflare_webgate.py: Separate implementation issues.

@ZubairAli999

Copy link
Copy Markdown
Author

@soxoj issue solve this new PR (#2766 )

@soxoj

soxoj commented Jun 13, 2026

Copy link
Copy Markdown
Owner

@ZubairAli999 please, keep only one PR for #2667.

@soxoj soxoj marked this pull request as draft June 13, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants