Open janbuchar opened 1 week ago
rather then
if (
context.session
and status_code not in self._http_client._ignore_http_error_status_codes # noqa: SLF001
and context.session.is_blocked_status_code(status_code=status_code)
):
use something like
if context.session and context.session.is_blocked_status_code(
status_code=status_code,
additional_blocked_status_codes=self._http_client.additional_blocked_status_codes,
ignore_http_error_status_codes=self._http_client.ignore_http_error_status_codes,
):
or come up with something better
The reasoning behind the change was that some errors (such as 401) are automatically considered
SessionError
and http-based crawlers don't takeignore_htttp_error_status_codes
into account for them. While uncommon, it should be possible to explicitly ignore any status code.