mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-09 12:21:57 -04:00
(#847) Decode error output hints to string if needed
This commit is contained in:
parent
b279c30b8d
commit
decab91ea2
1 changed files with 4 additions and 1 deletions
|
@ -432,7 +432,10 @@ def log_archive_method_finished(result: "ArchiveResult"):
|
||||||
# Prettify error output hints string and limit to five lines
|
# Prettify error output hints string and limit to five lines
|
||||||
hints = getattr(result.output, 'hints', None) or ()
|
hints = getattr(result.output, 'hints', None) or ()
|
||||||
if hints:
|
if hints:
|
||||||
hints = hints if isinstance(hints, (list, tuple)) else hints.split('\n')
|
if not isinstance(hints, (list, tuple)):
|
||||||
|
if isinstance(hints, bytes):
|
||||||
|
hints = hints.decode()
|
||||||
|
hints = hints.split('\n')
|
||||||
hints = (
|
hints = (
|
||||||
' {}{}{}'.format(ANSI['lightyellow'], line.strip(), ANSI['reset'])
|
' {}{}{}'.format(ANSI['lightyellow'], line.strip(), ANSI['reset'])
|
||||||
for line in hints[:5] if line.strip()
|
for line in hints[:5] if line.strip()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue