mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-25 23:47:47 +01:00
don't mask raised exceptions, to address #23
This commit is contained in:
parent
1a1aa814d0
commit
d347b4952b
@ -164,7 +164,6 @@ class ReferRedirect:
|
|||||||
if not any (wbrequest.referrer.startswith(i) for i in self.match_prefixs):
|
if not any (wbrequest.referrer.startswith(i) for i in self.match_prefixs):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
|
||||||
ref_split = urlparse.urlsplit(wbrequest.referrer)
|
ref_split = urlparse.urlsplit(wbrequest.referrer)
|
||||||
|
|
||||||
path = ref_split.path
|
path = ref_split.path
|
||||||
@ -190,9 +189,6 @@ class ReferRedirect:
|
|||||||
#final_url = urlparse.urlunsplit((ref_split.scheme, ref_split.netloc, ref_path[0] + str(ref_wb_url), '', ''))
|
#final_url = urlparse.urlunsplit((ref_split.scheme, ref_split.netloc, ref_path[0] + str(ref_wb_url), '', ''))
|
||||||
final_url = urlparse.urlunsplit((ref_split.scheme, ref_split.netloc, rewriter.rewrite(rel_request_uri), '', ''))
|
final_url = urlparse.urlunsplit((ref_split.scheme, ref_split.netloc, rewriter.rewrite(rel_request_uri), '', ''))
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
raise e
|
|
||||||
|
|
||||||
return WbResponse.redir_response(final_url)
|
return WbResponse.redir_response(final_url)
|
||||||
|
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ class RemoteCDXServer(IndexReader):
|
|||||||
msg = 'Blocked By Robots' if 'Blocked By Robots' in exc_msg else 'Excluded'
|
msg = 'Blocked By Robots' if 'Blocked By Robots' in exc_msg else 'Excluded'
|
||||||
raise wbexceptions.AccessException(msg)
|
raise wbexceptions.AccessException(msg)
|
||||||
else:
|
else:
|
||||||
raise e
|
raise
|
||||||
|
|
||||||
if parsed_cdx:
|
if parsed_cdx:
|
||||||
return (CDXCaptureResult(cdx) for cdx in response)
|
return (CDXCaptureResult(cdx) for cdx in response)
|
||||||
|
@ -89,9 +89,9 @@ def main():
|
|||||||
logging.info('*** pywb inited with settings from {0}.pywb_config()!\n'.format(config_name))
|
logging.info('*** pywb inited with settings from {0}.pywb_config()!\n'.format(config_name))
|
||||||
return app
|
return app
|
||||||
|
|
||||||
except Exception as e:
|
except Exception:
|
||||||
logging.exception('*** pywb could not init with settings from {0}.pywb_config()!\n'.format(config_name))
|
logging.exception('*** pywb could not init with settings from {0}.pywb_config()!\n'.format(config_name))
|
||||||
raise e
|
raise
|
||||||
|
|
||||||
#=================================================================
|
#=================================================================
|
||||||
if __name__ == "__main__" or utils.enable_doctests():
|
if __name__ == "__main__" or utils.enable_doctests():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user