diff --git a/marathon/client.py b/marathon/client.py index a57256d..d83f4c9 100644 --- a/marathon/client.py +++ b/marathon/client.py @@ -119,11 +119,12 @@ def _do_sse_request(self, path): headers={'Accept': 'text/event-stream'}, auth=self.auth ) + if response.ok: + return response.iter_lines() + response.raise_for_status() except Exception as e: marathon.log.error('Error while calling %s: %s', url, e.message) - if response.ok: - return response.iter_lines() raise MarathonError('No remaining Marathon servers to try')