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

add core exceptions #26

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions web_poet/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class ReloadResponseData(Exception):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking of a way to indicate the maximum retry attempts in this exception.

However, it's best to leave that to the framework using web-poet to standardize limits, delays, etc.

"""Indicates that there's something wrong with :class:`~.ResponseData` and
it needs to be downloaded again.

You should use this in instance where the HTTP Response is malformed, missing
some required information, etc.

This should be raised inside the subclasses of :class:`~.WebPage` or anything
which requires :class:`~.ResponseData` as a dependency. The framework which
handles the Page Objects should then attempt to create a new instance with a
fresh :class:`~.ResponseData` dependency.
"""
pass