Skip to content

Commit

Permalink
Use response.raise_for_status() instead of RuntimeError
Browse files Browse the repository at this point in the history
Signed-off-by: Jürgen Löhel <[email protected]>
  • Loading branch information
jloehel committed Sep 27, 2020
1 parent 48dd701 commit 2b642c1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions logstash_async/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,5 @@ def send(self, events, **kwargs):
auth=self.__auth())
if response.status_code != 200:
self.close()
error = '{code} - {reason}'.format(
code=response.status_code, reason=response.reason)
raise RuntimeError(error)
response.raise_for_status()
self.close()

0 comments on commit 2b642c1

Please sign in to comment.