mirror of https://github.com/CIRCL/lookyloo
fix: Properly handle json dumps
parent
1d77a2001e
commit
605dc00989
|
@ -261,7 +261,9 @@ class Lookyloo():
|
|||
with (Path(capture_dir) / 'error.txt').open() as _error:
|
||||
content = _error.read()
|
||||
try:
|
||||
error_to_cache = json.loads(content)['details']
|
||||
error_to_cache = json.loads(content)
|
||||
if isinstance(error_to_cache, dict) and error_to_cache.get('details'):
|
||||
error_to_cache = error_to_cache.get('details')
|
||||
except json.decoder.JSONDecodeError:
|
||||
# old format
|
||||
error_to_cache = content
|
||||
|
|
Loading…
Reference in New Issue