{"action":"opened","issue":{"url":"https://api.github.com/repos/kontena/kontena/issues/1303","repository_url":"https://api.github.com/repos/kontena/kontena","labels_url":"https://api.github.com/repos/kontena/kontena/issues/1303/labels{/name}","comments_url":"https://api.github.com/repos/kontena/kontena/issues/1303/comments","events_url":"https://api.github.com/repos/kontena/kontena/issues/1303/events","html_url":"https://github.com/kontena/kontena/issues/1303","id":188441498,"number":1303,"title":"Server API: Consistent error response format","user":{"login":"SpComb","id":3950373,"avatar_url":"https://avatars.githubusercontent.com/u/3950373?v=3","gravatar_id":"","url":"https://api.github.com/users/SpComb","html_url":"https://github.com/SpComb","followers_url":"https://api.github.com/users/SpComb/followers","following_url":"https://api.github.com/users/SpComb/following{/other_user}","gists_url":"https://api.github.com/users/SpComb/gists{/gist_id}","starred_url":"https://api.github.com/users/SpComb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpComb/subscriptions","organizations_url":"https://api.github.com/users/SpComb/orgs","repos_url":"https://api.github.com/users/SpComb/repos","events_url":"https://api.github.com/users/SpComb/events{/privacy}","received_events_url":"https://api.github.com/users/SpComb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-10T07:49:32Z","updated_at":"2016-11-10T07:49:32Z","closed_at":null,"body":"The server API is currently inconsistent in terms of the error response syntax used for different requests. We should decide on one JSON `{\"error\": ...}` response format and use that consistently, in order to ensure that the CLI is able to report any errors in the best possible way.\r\n\r\nBeyond #1302, at least the following need fixing based on a quick search:\r\n\r\n* https://github.com/kontena/kontena/blob/50376cc0edefdea8a2bb8d05c3bb444113e80537/server/app/routes/v1/services/service_envs.rb#L32\r\n* https://github.com/kontena/kontena/blob/50376cc0edefdea8a2bb8d05c3bb444113e80537/server/app/routes/v1/services/service_envs.rb#L32\r\n* https://github.com/kontena/kontena/blob/50376cc0edefdea8a2bb8d05c3bb444113e80537/server/app/routes/v1/grids/external_registries.rb#L30\r\n\r\nWe should also figure out what the exact mechanics of the `{\"error\": mutation_outcome.errors.message}` is, it appears to be a hash of `parameter => error-message`. We should consider also exposing the symbolic mutations errors for programatic clients, and something for the CLI to format the human-readable errors properly."}}
{"actor":{"display_login":"SpComb"}}