[cluster] Bubble up authentication errors on remote clusters
@@ -163,12 +163,15 @@ class HueQuery():
payload = payload.replace('SELECT+*+FROM+web_logs+LIMIT+100', urllib.quote_plus(query.replace('\n', ' ')))
resp = self.api.submit_hue_query(self.cluster_crn, payload)
- resp_payload = json.loads(resp['payload'])
+ if 'payload' in resp:
+ resp_payload = json.loads(resp['payload'])
if 'handle' in resp_payload:
return resp_payload['handle']
else:
raise QueryError(resp_payload.get('message'))
+ else:
+ raise QueryError(resp.get('message'))
def do_check_status(self, handle):
