Open Mr0grog opened 3 years ago
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.
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 genericMementoPlaybackError
.We also have a TODO in the code that references this: https://github.com/edgi-govdata-archiving/wayback/blob/c066e04c1ba11c26febac574b37ee739cc5796e2/wayback/exceptions.py#L32-L40
I’m thinking
MementoOutsideWindow
,MementoOutOfWindow
, orMementoOutOfRange
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 “targetrange.” ¯\_(ツ)\/¯Regardless of the name, it should be a subclass of
MementoPlaybackError
.