apify / apify-sdk-python

The Apify SDK for Python is the official library for creating Apify Actors in Python. It provides useful features like actor lifecycle management, local storage emulation, and actor event handling.
https://docs.apify.com/sdk/python
Apache License 2.0
115 stars 11 forks source link

Improve error handling for `to_apify_request` serialization failures #191

Closed vdusek closed 6 months ago

vdusek commented 6 months ago

The PR addresses the problem identified in Issue #189, where to_apify_request could fail silently during serialization of the Scrapy request. This PR has introduced enhanced error handling to ensure users are informed if serialization of a request fails, preventing the request from being not enqueued without notification.

vdusek commented 6 months ago

Maybe we should log it as errors rather than warnings, since it actually is an issue that the developers should solve. But I agree that it's better to not fail the whole Actor in this case.

Ok, enqueue_request logs an error message when the conversion fails.