Skip to content

Conversation

@Mantisus
Copy link
Collaborator

Description

  • Fix getting an error message for errors not having message data in args. If the error was raised in a chain, tries to get the previous error message from __context__. Otherwise uses the error class name as the message.

Issues

Testing

  • Add new tests

@Mantisus Mantisus requested review from Pijukatel and Copilot April 29, 2025 01:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Mantisus Mantisus changed the title fix: fix handle error without args in _get_error_message for ErrorTracker fix: fix handle error without args in _get_error_message for ErrorTracker Apr 29, 2025
@Mantisus Mantisus self-assigned this Apr 29, 2025
@Pijukatel Pijukatel merged commit 21944d9 into apify:master Apr 29, 2025
23 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.

Сritical error in ErrorTracker in specific error handling cases

2 participants