{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry-incubator/receptor/issues/14","labels_url":"https://api.github.com/repos/cloudfoundry-incubator/receptor/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry-incubator/receptor/issues/14/comments","events_url":"https://api.github.com/repos/cloudfoundry-incubator/receptor/issues/14/events","html_url":"https://github.com/cloudfoundry-incubator/receptor/pull/14","id":73678454,"number":14,"title":"Receptor client handles non-JSON error responses from receptor.","user":{"login":"davidwadden","id":9936700,"avatar_url":"https://avatars.githubusercontent.com/u/9936700?v=3","gravatar_id":"","url":"https://api.github.com/users/davidwadden","html_url":"https://github.com/davidwadden","followers_url":"https://api.github.com/users/davidwadden/followers","following_url":"https://api.github.com/users/davidwadden/following{/other_user}","gists_url":"https://api.github.com/users/davidwadden/gists{/gist_id}","starred_url":"https://api.github.com/users/davidwadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidwadden/subscriptions","organizations_url":"https://api.github.com/users/davidwadden/orgs","repos_url":"https://api.github.com/users/davidwadden/repos","events_url":"https://api.github.com/users/davidwadden/events{/privacy}","received_events_url":"https://api.github.com/users/davidwadden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-06T17:01:32Z","updated_at":"2015-05-08T00:58:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cloudfoundry-incubator/receptor/pulls/14","html_url":"https://github.com/cloudfoundry-incubator/receptor/pull/14","diff_url":"https://github.com/cloudfoundry-incubator/receptor/pull/14.diff","patch_url":"https://github.com/cloudfoundry-incubator/receptor/pull/14.patch"},"body":"As described in #13, Lattice is receiving empty error responses from the receptor client in certain cases.\r\n\r\nWe've made the receptor client more robust in dealing with non-JSON formatted responses.\r\n\r\nPlease review our pull request and let us know if you have any additional feedback.\r\n\r\nJust a note:\r\n\r\nWe identified another place the receptor client would deliver an empty error.  If [client.go:257](https://github.com/cloudfoundry-incubator/receptor/compare/cloudfoundry-incubator:master...davidwadden:client-error-handling?expand=1#diff-d0b7f86cea13f90d3cc0cc2338da8d5fR257) returns an error, it will not be a `receptor.Error`.  This might happen from a 200 OK response that has malformed JSON.  We'd be willing to modify this PR to instead return a `receptor.Error{Type: InvalidJSON, Message: string(body)}` if this line returns an error.\r\n\r\nRegards,\r\nDavid"},"comment":{"url":"https://api.github.com/repos/cloudfoundry-incubator/receptor/issues/comments/100057445","html_url":"https://github.com/cloudfoundry-incubator/receptor/pull/14#issuecomment-100057445","issue_url":"https://api.github.com/repos/cloudfoundry-incubator/receptor/issues/14","id":100057445,"user":{"login":"luan","id":223760,"avatar_url":"https://avatars.githubusercontent.com/u/223760?v=3","gravatar_id":"","url":"https://api.github.com/users/luan","html_url":"https://github.com/luan","followers_url":"https://api.github.com/users/luan/followers","following_url":"https://api.github.com/users/luan/following{/other_user}","gists_url":"https://api.github.com/users/luan/gists{/gist_id}","starred_url":"https://api.github.com/users/luan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luan/subscriptions","organizations_url":"https://api.github.com/users/luan/orgs","repos_url":"https://api.github.com/users/luan/repos","events_url":"https://api.github.com/users/luan/events{/privacy}","received_events_url":"https://api.github.com/users/luan/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T00:58:27Z","updated_at":"2015-05-08T00:58:27Z","body":"Hi @davidwadden,\r\n\r\nThis is definitely something that needs to be solved.\r\nWe looked at the way you solved it and we think it might be cleaner if we look at the Content-Type of the response to chose which type of decoding we're going to do rather than expecting a JSON decode error.\r\nCan you give that a shot and update the PR?\r\n\r\nThanks,\r\n@luan && @fraenkel, CF Diego Team"}}