diff --git a/raiden/accounts.py b/raiden/accounts.py index 6d26b6422d..0237793ee5 100644 --- a/raiden/accounts.py +++ b/raiden/accounts.py @@ -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)