mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-28 08:32:29 +01:00
not_found: catch NotFoundException from any part of handle_request, not just indexing.. allows for more flexible
usage with cdx iterators that are lazily evaluated on replay
This commit is contained in:
parent
148651680a
commit
90aba00ca0
@ -69,7 +69,10 @@ class SearchPageWbUrlHandler(WbUrlHandler):
|
|||||||
else:
|
else:
|
||||||
wbrequest.final_mod = 'tf_'
|
wbrequest.final_mod = 'tf_'
|
||||||
|
|
||||||
|
try:
|
||||||
return self.handle_request(wbrequest)
|
return self.handle_request(wbrequest)
|
||||||
|
except NotFoundException as nfe:
|
||||||
|
return self.handle_not_found(wbrequest, nfe)
|
||||||
|
|
||||||
def get_top_frame_params(self, wbrequest, mod=''):
|
def get_top_frame_params(self, wbrequest, mod=''):
|
||||||
embed_url = wbrequest.wb_url.to_str(mod=mod, url='')
|
embed_url = wbrequest.wb_url.to_str(mod=mod, url='')
|
||||||
@ -133,10 +136,7 @@ class WBHandler(SearchPageWbUrlHandler):
|
|||||||
self.fallback_handler = handler_dict.get(self.fallback_name)
|
self.fallback_handler = handler_dict.get(self.fallback_name)
|
||||||
|
|
||||||
def handle_request(self, wbrequest):
|
def handle_request(self, wbrequest):
|
||||||
try:
|
|
||||||
cdx_lines, output = self.index_reader.load_for_request(wbrequest)
|
cdx_lines, output = self.index_reader.load_for_request(wbrequest)
|
||||||
except NotFoundException as nfe:
|
|
||||||
return self.handle_not_found(wbrequest, nfe)
|
|
||||||
|
|
||||||
if output != 'text' and wbrequest.wb_url.is_replay():
|
if output != 'text' and wbrequest.wb_url.is_replay():
|
||||||
return self.handle_replay(wbrequest, cdx_lines)
|
return self.handle_replay(wbrequest, cdx_lines)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user