Skip to content

Commit

Permalink
handle errors with negative return code better
Browse files Browse the repository at this point in the history
  • Loading branch information
rndmh3ro committed Apr 24, 2024
1 parent fc4f19a commit 7d10ebc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/modules/grafana_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ def _send_request(self, url, data=None, headers=None, method="GET"):
)
elif status_code == 403:
self._module.fail_json(failed=True, msg="Permission Denied")
elif status_code < 0:
self._module.fail_json(failed=True, msg=info["msg"])
elif status_code == 200:
return self._module.from_json(resp.read())
self._module.fail_json(
Expand Down

0 comments on commit 7d10ebc

Please sign in to comment.