Skip to content
New issue

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

No JSON response on failures #67

Closed
sherzberg opened this issue Jul 6, 2015 · 3 comments
Closed

No JSON response on failures #67

sherzberg opened this issue Jul 6, 2015 · 3 comments

Comments

@sherzberg
Copy link
Contributor

The error codes seem to be fine, but there is no json output for some api errors:

$ curl -sL http://192.168.33.10:7000/api/brokers/add?id=0       
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 400 </title>
</head>
<body>
<h2>HTTP ERROR: 400</h2>
<p>Problem accessing /api/brokers/add. Reason:
<pre>    Broker 0 already exists</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>
$ curl -sL http://192.168.33.10:7000/api/brokers/stop?id=999     
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 400 </title>
</head>
<body>
<h2>HTTP ERROR: 400</h2>
<p>Problem accessing /api/brokers/stop. Reason:
<pre>    broker 999 not found</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>
@joestein joestein added the bug label Jul 7, 2015
@joestein
Copy link
Contributor

joestein commented Jul 7, 2015

it might be good to have a field for status so it can be parsed on failure (or success) and on failure parse the error, is that what you were thinking?

@sherzberg
Copy link
Contributor Author

@joestein yea that would be great. just something that is json parse-able.

my team is currently building some tools around the api and if I can get some free time, I can try to get a PR for you. but if you have time and the need, feel free to take it on :)

@dmitrypekar
Copy link
Contributor

Merged PR with small changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants