Skip to content

Commit

Permalink
improve error message on wrong/invalid credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka committed Feb 2, 2018
1 parent 80e8dda commit c29e675
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,14 @@ def policy_name(queue_name):
return "{}-balancer-temp".format(queue_name)

def get_queues(self):
response = self.conn.get(self.queues_url).json()
return response
response = self.conn.get(self.queues_url)
if response.status_code == 200:
return response.json()
elif response.status_code == 401:
raise Exception(
"Received a 401 http error. Are your username/password options correct? "
"Do your user has the 'administrator' tag?"
)

def ordered_queue_list(self):
# type: (None) -> dict
Expand Down

0 comments on commit c29e675

Please sign in to comment.