Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions raiden/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,19 @@ def __init__(self, keystore_path: str = None):
self.accounts[address] = str(fullpath)
except (
IOError,
OSError,
) as ex:
msg = 'Can not read account file (errno=%s)' % ex.errno
log.warning(msg, path=fullpath, ex=ex)
except(
json.JSONDecodeError,
KeyError,
OSError,
UnicodeDecodeError,
) as ex:
# Invalid file - skip
if f.startswith('UTC--'):
# Should be a valid account file - warn user
msg = 'Invalid account file'
if isinstance(ex, IOError) or isinstance(ex, OSError):
msg = 'Can not read account file (errno=%s)' % ex.errno
if isinstance(ex, json.decoder.JSONDecodeError):
msg = 'The account file is not valid JSON format'
log.warning(msg, path=fullpath, ex=ex)
Expand Down