{"action":"opened","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/653","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/653/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/653/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/653/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/issues/653","id":57826025,"number":653,"title":"Attribute error thrown in gcloud/exceptions.py","user":{"login":"craigloftus","id":88151,"avatar_url":"https://avatars.githubusercontent.com/u/88151?v=3","gravatar_id":"","url":"https://api.github.com/users/craigloftus","html_url":"https://github.com/craigloftus","followers_url":"https://api.github.com/users/craigloftus/followers","following_url":"https://api.github.com/users/craigloftus/following{/other_user}","gists_url":"https://api.github.com/users/craigloftus/gists{/gist_id}","starred_url":"https://api.github.com/users/craigloftus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigloftus/subscriptions","organizations_url":"https://api.github.com/users/craigloftus/orgs","repos_url":"https://api.github.com/users/craigloftus/repos","events_url":"https://api.github.com/users/craigloftus/events{/privacy}","received_events_url":"https://api.github.com/users/craigloftus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-16T16:39:37Z","updated_at":"2015-02-16T16:39:37Z","closed_at":null,"body":"If I use an incorrect `dataset_id` I get an `AttributeError` when I try to make an API call, because `payload` in the exception is set to `b'Backend Error'`.\r\n\r\n> gcloud/exceptions.py in make_exception(response, content, use_json)\r\n> 186\r\n> --> 187     message = payload.get('message', message)\r\n> 188     errors = payload.get('error', {}).get('errors', ())\r\n> 189\r\n>\r\n> AttributeError: 'bytes' object has no attribute 'get'\r\n\r\nThis is with `gcloud==0.4.1` on Python 3.4.2.\r\n\r\nCode to reproduce:\r\n```\r\nfrom gcloud import datastore\r\ndatastore.set_defaults(dataset_id=123456789)\r\nquery = datastore.Query(kind=\"SomeKind\")\r\nlist(query.fetch())\r\n```\r\n\r\nExpected behaviour would be for a helpfully worded exception to be thrown."}}