diff --git a/blockstack_client/actions.py b/blockstack_client/actions.py index 3fcb1b4c1..c47156e17 100644 --- a/blockstack_client/actions.py +++ b/blockstack_client/actions.py @@ -724,6 +724,9 @@ def cli_get_registrar_info(args, config_path=CONFIG_PATH, queues=None): log.error("Failed to contact Blockstack daemon") return {'error': 'Failed to contact blockstack daemon. Please ensure that it is running with the `api` command.'} + if 'error' in current_state: + return current_state + queue_types = dict( [(queue_name, []) for queue_name in queues] ) def format_queue_entry(entry): @@ -846,6 +849,8 @@ def get_server_info(config_path=CONFIG_PATH, get_local_info=False): queue_info = cli_get_registrar_info(None, config_path=config_path) if 'error' not in queue_info: result['queues'] = queue_info + else: + return queue_info return result diff --git a/blockstack_client/rpc.py b/blockstack_client/rpc.py index 04d1d0fe7..342c9da3c 100644 --- a/blockstack_client/rpc.py +++ b/blockstack_client/rpc.py @@ -3553,6 +3553,11 @@ class BlockstackAPIEndpointClient(object): except: resp = {'error': 'No JSON response', 'http_status': req.status_code} + if req.status_code == 403: + resp['error'] = ('Authentication to API service failed. Are you ' + + 'using the correct API password or do you need to pass the ' + + 'correct one with --api_password ?') + del resp['http_status'] return resp