Merge pull request #51 from lbryio/restart-lbrycrd

add a more useful exception if auth fails on lbrycrd
This commit is contained in:
Job Evers‐Meltzer 2016-07-04 15:45:44 -05:00 committed by GitHub
commit 42c77bbb67

View file

@ -726,7 +726,11 @@ class LBRYcrdWallet(LBRYWallet):
tries = 0 tries = 0
try: try:
rpc_conn = self._get_rpc_conn() rpc_conn = self._get_rpc_conn()
rpc_conn.getinfo() try:
rpc_conn.getinfo()
except ValueError:
log.exception('Failed to get rpc info. Rethrowing with a hopefully more useful error message')
raise Exception('Failed to get rpc info from lbrycrdd. Try restarting lbrycrdd')
log.info("lbrycrdd was already running when LBRYcrdWallet was started.") log.info("lbrycrdd was already running when LBRYcrdWallet was started.")
return return
except (socket.error, JSONRPCException): except (socket.error, JSONRPCException):
@ -1267,4 +1271,4 @@ class LBRYcrdAddressQueryHandler(object):
log.warning("Expected a request for an address, but did not receive one") log.warning("Expected a request for an address, but did not receive one")
return defer.fail(Failure(ValueError("Expected but did not receive an address request"))) return defer.fail(Failure(ValueError("Expected but did not receive an address request")))
else: else:
return defer.succeed({}) return defer.succeed({})