Skip to content

Improve exception handling - #1563

Merged
maurosoria merged 3 commits into
masterfrom
improve-exception-handling
Jun 3, 2026
Merged

Improve exception handling#1563
maurosoria merged 3 commits into
masterfrom
improve-exception-handling

Conversation

@maurosoria

Copy link
Copy Markdown
Owner

Summary

  • replace bare/generic raised exceptions with domain-appropriate built-in exceptions
  • narrow clear parser/report/option exception wrappers and preserve causes with exception chaining
  • keep defensive broad catches at runtime fail-safe boundaries
  • add regression coverage for report validation, SQLite validation, and raw request parse failures

Validation

  • git diff --check
  • /home/mauro/dirsearch/.venv/bin/python -m py_compile lib/controller/controller.py lib/core/options.py lib/parse/rawrequest.py lib/parse/url.py lib/report/csv_report.py lib/report/factory.py lib/report/mysql_report.py lib/report/postgresql_report.py lib/report/sqlite_report.py lib/utils/schemedet.py tests/test_report_exception_handling.py
  • /home/mauro/dirsearch/.venv/bin/python -m unittest tests.test_report_exception_handling tests.test_optional_db_dependencies tests.parse.test_nmap tests.utils.test_safe_xml tests.parse.test_url tests.utils.test_schemedet
  • /home/mauro/dirsearch/.venv/bin/python dirsearch.py -u https://example.com -w tests/static/wordlist.txt -q

Known existing issue: /home/mauro/dirsearch/.venv/bin/python testing.py still fails in the native backend path with scan_http() got an unexpected keyword argument 'include_status_codes'.

Comment thread lib/report/factory.py Fixed
@maurosoria
maurosoria marked this pull request as ready for review June 3, 2026 10:46
@maurosoria
maurosoria merged commit 1d00d2f into master Jun 3, 2026
15 checks passed
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.

2 participants