fix: fix handle error without `args` in `_get_error_message` for `ErrorTracker` by Mantisus · Pull Request #1181 · apify/crawlee-python

Pull Request Overview

This PR fixes the error message handling within ErrorTracker, ensuring that errors without message data in args are handled correctly by falling back to the previous error’s message from context or the error class name.

  • Updated error message logic in _get_error_message to support errors without message arguments.
  • Adjusted test expectations and added a new test for errors raised in a chain.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/unit/_statistics/test_error_tracker.py Updated expected error counts and added a new test for error chains.
src/crawlee/statistics/_error_tracker.py Modified _get_error_message to correctly handle errors without args.