mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-28 13:44:14 -04:00
Add exception handling for indexable content reader
This commit is contained in:
parent
b1d70185ed
commit
5a6b814c79
1 changed files with 10 additions and 2 deletions
|
@ -97,6 +97,14 @@ def index_links(links: Union[List[Link],None], out_dir: Path=OUTPUT_DIR):
|
||||||
for link in links:
|
for link in links:
|
||||||
if snap := Snapshot.objects.filter(url=link.url).first():
|
if snap := Snapshot.objects.filter(url=link.url).first():
|
||||||
results = ArchiveResult.objects.indexable().filter(snapshot=snap)
|
results = ArchiveResult.objects.indexable().filter(snapshot=snap)
|
||||||
texts = get_indexable_content(results)
|
|
||||||
log_index_started(link.url)
|
log_index_started(link.url)
|
||||||
write_search_index(link, texts, out_dir=out_dir)
|
try:
|
||||||
|
texts = get_indexable_content(results)
|
||||||
|
except Exception as err:
|
||||||
|
stderr()
|
||||||
|
stderr(
|
||||||
|
f'[X] An Exception ocurred reading the indexable content={err}:',
|
||||||
|
color='red',
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
write_search_index(link, texts, out_dir=out_dir)
|
Loading…
Add table
Add a link
Reference in a new issue