From 12d378af13ce0d13ebcedb1b1837afc7d3648f94 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 3 Apr 2018 12:25:18 -0400 Subject: [PATCH] show not connected error in lbrynet-cli when using auth --- lbrynet/daemon/DaemonCLI.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lbrynet/daemon/DaemonCLI.py b/lbrynet/daemon/DaemonCLI.py index 594a2f215..7ec03aa34 100644 --- a/lbrynet/daemon/DaemonCLI.py +++ b/lbrynet/daemon/DaemonCLI.py @@ -10,6 +10,7 @@ from lbrynet.daemon.auth.client import JSONRPCException, LBRYAPIClient, AuthAPIC from lbrynet.daemon.Daemon import LOADING_WALLET_CODE, Daemon from lbrynet.core.system_info import get_platform from jsonrpc.common import RPCError +from requests.exceptions import ConnectionError from urllib2 import URLError, HTTPError from httplib import UNAUTHORIZED @@ -87,11 +88,11 @@ def main(): kwargs = set_flag_vals(flag_names, parsed) colorama.init() conf.initialize_settings() - api = LBRYAPIClient.get_client() try: + api = LBRYAPIClient.get_client() status = api.status() - except URLError as err: + except (URLError, ConnectionError) as err: if isinstance(err, HTTPError) and err.code == UNAUTHORIZED: api = AuthAPIClient.config() # this can happen if the daemon is using auth with the --http-auth flag