You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a new user of this project and I've been trying to implement it in my own code. While working with it, I noticed a pattern in the error handling across request functions like _send_pycurl_request and _send_urllib_request that I'd like to understand better.
Both of these functions catch exceptions and return None in error cases:
# In _send_urllib_requestexceptExceptionaserr:
LOGGER.error("download error: %s %s", url, err)
returnNone
This makes it challenging for calling code (like fetch_url and fetch_response) to determine:
Whether an error occurred
What type of error occurred
How to handle specific error cases
I'm wondering if there's a specific design reason for returning None instead of raising exceptions or returning a more informative error response? Are there plans to enhance the error handling approach in future versions?
I understand there might be good architectural reasons for this design that I'm missing as a new user, so I appreciate any insight you can provide.
Thank you!
The text was updated successfully, but these errors were encountered:
Hello,
I'm a new user of this project and I've been trying to implement it in my own code. While working with it, I noticed a pattern in the error handling across request functions like
_send_pycurl_request
and_send_urllib_request
that I'd like to understand better.Both of these functions catch exceptions and return
None
in error cases:This makes it challenging for calling code (like
fetch_url
andfetch_response
) to determine:I'm wondering if there's a specific design reason for returning
None
instead of raising exceptions or returning a more informative error response? Are there plans to enhance the error handling approach in future versions?I understand there might be good architectural reasons for this design that I'm missing as a new user, so I appreciate any insight you can provide.
Thank you!
The text was updated successfully, but these errors were encountered: