Changeset View
Changeset View
Standalone View
Standalone View
swh/web/browse/views/revision.py
Show First 20 Lines • Show All 276 Lines • ▼ Show 20 Lines | try: | ||||
dir_id = None | dir_id = None | ||||
dirs, files = None, None | dirs, files = None, None | ||||
content_data = None | content_data = None | ||||
if origin_url: | if origin_url: | ||||
try: | try: | ||||
snapshot_context = get_snapshot_context( | snapshot_context = get_snapshot_context( | ||||
origin_url=origin_url, timestamp=timestamp, | origin_url=origin_url, timestamp=timestamp, | ||||
visit_id=visit_id) | visit_id=visit_id) | ||||
except Exception: | except NotFoundExc: | ||||
vlorentz: note that I changed this to be stricted. But this block is wrapped in a larger `except… | |||||
raw_rev_url = reverse('browse-revision', | raw_rev_url = reverse('browse-revision', | ||||
url_args={'sha1_git': sha1_git}) | url_args={'sha1_git': sha1_git}) | ||||
error_message = \ | error_message = \ | ||||
('The Software Heritage archive has a revision ' | ('The Software Heritage archive has a revision ' | ||||
'with the hash you provided but the origin ' | 'with the hash you provided but the origin ' | ||||
'mentioned in your request appears broken: %s. ' | 'mentioned in your request appears broken: %s. ' | ||||
'Please check the URL and try again.\n\n' | 'Please check the URL and try again.\n\n' | ||||
'Nevertheless, you can still browse the revision ' | 'Nevertheless, you can still browse the revision ' | ||||
▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines |
note that I changed this to be stricted. But this block is wrapped in a larger except Exception as exc:, which will catch other exceptions, if any.