Skip to content

Commit 0ffbd78

Browse files
Artur Dobrogowskiamotl
authored andcommitted
fixing the uncaught exception when message is not json but has message word in it
1 parent eee2652 commit 0ffbd78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

grafana_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __request_runnner(url, json=None, headers=None):
113113
response = r.json()
114114
except ValueError:
115115
response = r.text
116-
message = response["message"] if "message" in response else r.text
116+
message = response["message"] if type(response) == dict and "message" in response else r.text
117117

118118
if 500 <= r.status_code < 600:
119119
raise GrafanaServerError(

0 commit comments

Comments
 (0)