Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controll what to do in case of error responses #51

Merged
merged 1 commit into from Oct 18, 2022
Merged

Conversation

otsch
Copy link
Member

@otsch otsch commented Oct 18, 2022

New methods stopOnErrorResponse() and yieldErrorResponses() that can be used with Http steps. By calling stopOnErrorResponse() the step will throw a LoadingException when a response has a 4xx or 5xx status code. By calling the yieldErrorResponse() even error responses will be yielded and passed on to the next steps.

The latter actually was the default behavior until now, but I think most people would either like to just ignore error responses or the whole crawler to fail/stop, so I changed this.

New methods `stopOnErrorResponse()` and `yieldErrorResponses()` that can
be used with `Http` steps. By calling `stopOnErrorResponse()` the step
will throw a `LoadingException` when a response has a 4xx or 5xx status
code. By calling the `yieldErrorResponse()` even error responses will be
yielded and passed on to the next steps.

The latter actually was the default behavior until now, but I think most
people would either like to just ignore error responses or the whole
crawler to fail/stop, so I changed this.
@otsch otsch merged commit 0ed1cb3 into main Oct 18, 2022
@otsch otsch deleted the error-responses branch October 18, 2022 00:35
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.

None yet

1 participant