File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,21 @@ def fetch_well_known_config(idp_url):
9191 try :
9292 response = requests .request (method = "GET" , url = known_config_url )
9393 except RequestException :
94- error_and_quit ("Unable to fetch OAuth configuration from {idp_url}."
95- "Verify that OAuth is enabled on this account." .format (idp_url = idp_url ))
94+ error_and_quit ("Unable to fetch OAuth configuration from {idp_url}.\n "
95+ "Verify it is a valid workspace URL and that OAuth is "
96+ "enabled on this account." .format (idp_url = idp_url ))
9697
9798 if response .status_code != 200 :
98- error_and_quit ("Unable to fetch OAuth configuration from {idp_url}. "
99- "Verify that OAuth is enabled on this account." .format (idp_url = idp_url ))
100- return json .loads (response .text )
99+ error_and_quit ("Received status {status} OAuth configuration from "
100+ "{idp_url}.\n Verify it is a valid workspace URL and "
101+ "that OAuth is enabled on this account."
102+ .format (status = response .status_code , idp_url = idp_url ))
103+ try :
104+ return json .loads (response .text )
105+ except json .decoder .JSONDecodeError :
106+ error_and_quit ("Unable to decode OAuth configuration from {idp_url}.\n "
107+ "Verify it is a valid workspace URL and that OAuth is "
108+ "enabled on this account." .format (idp_url = idp_url ))
101109
102110
103111def get_idp_url (host ):
You can’t perform that action at this time.
0 commit comments