# HG changeset patch # User Marcin Kuzminski # Date 2013-05-22 21:36:59 # Node ID 8dae2a2883397539d040eb10ddcb41efebadd756 # Parent e39fb661998b80ac65f245b603ac9761f64aa26e API cli should prefer to display errors instead of responses diff --git a/rhodecode/bin/rhodecode_api.py b/rhodecode/bin/rhodecode_api.py --- a/rhodecode/bin/rhodecode_api.py +++ b/rhodecode/bin/rhodecode_api.py @@ -105,7 +105,11 @@ def main(argv=None): if args.format == FORMAT_PRETTY: print 'Calling method %s => %s' % (method, apihost) - json_data = api_call(apikey, apihost, method, **margs)['result'] + json_resp = api_call(apikey, apihost, method, **margs) + if json_resp['error']: + json_data = json_resp['error'] + else: + json_data = json_resp['result'] if args.format == FORMAT_JSON: print json.dumps(json_data) elif args.format == FORMAT_PRETTY: