{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/18363","labels_url":"https://api.github.com/repos/docker/docker/issues/18363/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/18363/comments","events_url":"https://api.github.com/repos/docker/docker/issues/18363/events","html_url":"https://github.com/docker/docker/issues/18363","id":119943126,"number":18363,"title":"networking API: bad HTTP status reporting on errors","user":{"login":"fsouza","id":108725,"avatar_url":"https://avatars.githubusercontent.com/u/108725?v=3","gravatar_id":"","url":"https://api.github.com/users/fsouza","html_url":"https://github.com/fsouza","followers_url":"https://api.github.com/users/fsouza/followers","following_url":"https://api.github.com/users/fsouza/following{/other_user}","gists_url":"https://api.github.com/users/fsouza/gists{/gist_id}","starred_url":"https://api.github.com/users/fsouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsouza/subscriptions","organizations_url":"https://api.github.com/users/fsouza/orgs","repos_url":"https://api.github.com/users/fsouza/repos","events_url":"https://api.github.com/users/fsouza/events{/privacy}","received_events_url":"https://api.github.com/users/fsouza/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/area/api","name":"area/api","color":"e11d21"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/enhancement","name":"kind/enhancement","color":"E8CAAF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-12-02T13:43:54Z","updated_at":"2015-12-05T14:11:18Z","closed_at":null,"body":"Currently the networking API always report 500 on failures (except in [special cases when the error message matches certain patterns](https://github.com/docker/docker/blob/e75da4b6fffbcf9dab86cd581e962a19d3efa35a/api/server/httputils/httputils.go#L129-L151)). Should HTTP handlers in the networking API use the [errcode package](https://godoc.org/github.com/docker/distribution/registry/api/errcode)? If so, I can prepare a patch for that."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/162191347","html_url":"https://github.com/docker/docker/issues/18363#issuecomment-162191347","issue_url":"https://api.github.com/repos/docker/docker/issues/18363","id":162191347,"user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T14:11:18Z","updated_at":"2015-12-05T14:11:18Z","body":"@fsouza Looks good!\r\nOne thing is we currently register errors in the package in `errors/`, and then call something like `return derr.NetworkNameConflict.WithArgs(create.Name)`"}}