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 MementoOutsideWindow Exception #54

Open
Mr0grog opened this issue Oct 19, 2020 · 1 comment
Open

Add MementoOutsideWindow Exception #54

Mr0grog opened this issue Oct 19, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers question Further information is requested
Milestone

Comments

@Mr0grog
Copy link
Member

Mr0grog commented Oct 19, 2020

Running into and fixing #53 reminded me that we don’t have a specific error for the situation where a memento can be served, but from a time that is beyond the specified target_window parameter. Instead, we currently just raise a fairly generic MementoPlaybackError.

We also have a TODO in the code that references this:

# TODO: split this up into a family of more specific errors? When playback
# failed partway into a redirect chain, when a redirect goes outside
# redirect_target_window, when a memento was circular?
class MementoPlaybackError(WaybackException):
"""
Raised when a Memento can't be 'played back' (loaded) by the Wayback
Machine for some reason. This is a server-side issue, not a problem in
parsing data from Wayback.
"""

I’m thinking MementoOutsideWindow, MementoOutOfWindow, or MementoOutOfRange are good candidates for names here. “Range” feels like more traditional wording, but doesn’t clearly match up with the parameter that causes it, which is “target_window.” We could also change the parameter name to “target_range.” ¯\_(ツ)_/¯

Regardless of the name, it should be a subclass of MementoPlaybackError.

@Mr0grog Mr0grog added enhancement New feature or request question Further information is requested labels Oct 19, 2020
@Mr0grog
Copy link
Member Author

Mr0grog commented Oct 19, 2020

It would also be great if we could include info about the actual Memento’s timestamp and the specified target window, so calling code can make decisions based on or display info about how far off a viable memento might be.

@Mr0grog Mr0grog added this to the v0.4.x milestone Nov 10, 2022
@Mr0grog Mr0grog added the good first issue Good for newcomers label Dec 13, 2023
@Mr0grog Mr0grog moved this to Backlog in Wayback Roadmap Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers question Further information is requested
Projects
Status: Backlog
Development

No branches or pull requests

1 participant