Improve namecoin init error handling

- partially addresses #896
This commit is contained in:
Peter Šurda 2016-08-31 16:24:28 +08:00
parent 59dba6a7c7
commit cc90747da1
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -273,9 +273,9 @@ def ensureNamecoinOptions ():
# Try to read user/password from .namecoin configuration file.
defaultUser = ""
defaultPass = ""
nmcFolder = lookupNamecoinFolder ()
nmcConfig = nmcFolder + "namecoin.conf"
try:
nmcFolder = lookupNamecoinFolder ()
nmcConfig = nmcFolder + "namecoin.conf"
nmc = open (nmcConfig, "r")
while True:
@ -295,7 +295,8 @@ def ensureNamecoinOptions ():
shared.namecoinDefaultRpcPort = val
nmc.close ()
except IOError:
logger.error("%s unreadable or missing, Namecoin support deactivated", nmcConfig)
except Exception as exc:
logger.warning("Error processing namecoin.conf", exc_info=True)