Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #46 from Sytten/master
Browse files Browse the repository at this point in the history
Fix exception inheritance and wrong message
  • Loading branch information
m0nhawk authored Sep 17, 2019
2 parents badb7c0 + d5c0522 commit 4723b3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions grafana_api/grafana_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ class GrafanaException(Exception):
pass


class GrafanaServerError(Exception):
class GrafanaServerError(GrafanaException):
"""
5xx
"""

pass


class GrafanaClientError(Exception):
class GrafanaClientError(GrafanaException):
"""
Invalid input (4xx errors)
"""
Expand Down Expand Up @@ -98,7 +98,7 @@ def __request_runnner(url, json=None, headers=None):
)
if 500 <= r.status_code < 600:
raise GrafanaServerError(
"Client Error {0}: {1}".format(r.status_code, r.json()['message'])
"Server Error {0}: {1}".format(r.status_code, r.json()['message'])
)
elif r.status_code == 400:
raise GrafanaBadInputError("Bad Input: `{0}`".format(r.text))
Expand Down

0 comments on commit 4723b3a

Please sign in to comment.