mesosphere/marathon — pull request #201 by guenter (2014-03-26 21:15:36+00:00)
Title: Better handling of invalid requests

Return more meaningful errors when receiving invalid requests

Invalid content type:

```
$ curl -i localhost:8080/v2/apps --data-binary garbage
HTTP/1.1 415 Unsupported Media Type
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(8.1.11.v20130520)

{"message":"Unsupported Media Type"}
```

Invalid JSON:

```
$ curl -i -H 'Content-Type: application/json' localhost:8080/v2/apps --data-binary garbage
HTTP/1.1 400 Bad Request
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(8.1.11.v20130520)

{"message":"Unrecognized token 'garbage': was expecting ('true', 'false' or 'null')"}
```