mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00:00
add exception details
This commit is contained in:
parent
fa79768f1e
commit
c292b377be
1 changed files with 5 additions and 5 deletions
10
archive.py
10
archive.py
|
@ -144,7 +144,7 @@ def fetch_wget(out_dir, link, overwrite=False):
|
||||||
try:
|
try:
|
||||||
run(CMD, stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # dom.html
|
run(CMD, stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # dom.html
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(' Exception: {}'.format(e.__class__.__name__))
|
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||||
else:
|
else:
|
||||||
print(' √ Skipping site download')
|
print(' √ Skipping site download')
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ def fetch_pdf(out_dir, link, overwrite=False):
|
||||||
try:
|
try:
|
||||||
run([CHROME_BINARY, *chrome_args, link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # output.pdf
|
run([CHROME_BINARY, *chrome_args, link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # output.pdf
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(' Exception: {}'.format(e.__class__.__name__))
|
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||||
else:
|
else:
|
||||||
print(' √ Skipping PDF print')
|
print(' √ Skipping PDF print')
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ def fetch_screenshot(out_dir, link, overwrite=False):
|
||||||
try:
|
try:
|
||||||
run([CHROME_BINARY, *chrome_args, '--window-size={}'.format(RESOLUTION), link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # sreenshot.png
|
run([CHROME_BINARY, *chrome_args, '--window-size={}'.format(RESOLUTION), link['url']], stdout=DEVNULL, stderr=DEVNULL, cwd=out_dir, timeout=20) # sreenshot.png
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(' Exception: {}'.format(e.__class__.__name__))
|
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||||
else:
|
else:
|
||||||
print(' √ Skipping screenshot')
|
print(' √ Skipping screenshot')
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ def archive_dot_org(out_dir, link, overwrite=False):
|
||||||
else:
|
else:
|
||||||
raise Exception('Failed to find Content-Location URL in Archive.org response headers.')
|
raise Exception('Failed to find Content-Location URL in Archive.org response headers.')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(' Exception: {}'.format(e.__class__.__name__))
|
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
with open('{}/archive.org.txt'.format(out_dir), 'w') as f:
|
with open('{}/archive.org.txt'.format(out_dir), 'w') as f:
|
||||||
|
@ -208,7 +208,7 @@ def fetch_favicon(out_dir, link, overwrite=False):
|
||||||
try:
|
try:
|
||||||
run([*CMD], stdout=fout, stderr=DEVNULL, cwd=out_dir, timeout=20) # dom.html
|
run([*CMD], stdout=fout, stderr=DEVNULL, cwd=out_dir, timeout=20) # dom.html
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(' Exception: {}'.format(e.__class__.__name__))
|
print(' Exception: {} {}'.format(e.__class__.__name__, e))
|
||||||
fout.close()
|
fout.close()
|
||||||
else:
|
else:
|
||||||
print(' √ Skipping favicon')
|
print(' √ Skipping favicon')
|
||||||
|
|
Loading…
Reference in a new issue