We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In this case, the return value is not JSON:
>>> c = MarathonClient('http://xulijian-mesos-online001-cqdx:8080', 'root', '111') >>> c.list_apps() ERROR:marathon:Got HTTP 401: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 401 Unauthorized</title> </head> <body> <h2>HTTP ERROR: 401</h2> <p>Problem accessing /v2/apps. Reason: <pre> Unauthorized</pre></p> <hr /><i><small>Powered by Jetty://</small></i> </body> </html> Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/iven/.local/share/virtualenvs/guardro/lib/python2.7/site-packages/marathon/client.py", line 134, in list_apps response = self._do_request('GET', '/v2/apps', params=params) File "/home/iven/.local/share/virtualenvs/guardro/lib/python2.7/site-packages/marathon/client.py", line 80, in _do_request raise MarathonHttpError(response) File "/home/iven/.local/share/virtualenvs/guardro/lib/python2.7/site-packages/marathon/exceptions.py", line 11, in __init__ content = response.json() File "/home/iven/.local/share/virtualenvs/guardro/lib/python2.7/site-packages/requests/models.py", line 799, in json return json.loads(self.text, **kwargs) File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded
The text was updated successfully, but these errors were encountered:
Yea, probably better for the request to check for a non 200 and raise a normal python exception
Sorry, something went wrong.
@iven do we agree that this issue is fixed by #178? With your example I now get:
>>> c.list_apps() Traceback (most recent call last): [...] MarathonHttpError: MarathonHttpError: HTTP 401 returned with message, "Unauthorized"
@hlerebours Sorry, I'm not using Marathon these days, but I think you can trust your test result. 😸
No branches or pull requests
In this case, the return value is not JSON:
The text was updated successfully, but these errors were encountered: