-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
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'.
gcloud/exceptions.py in make_exception(response, content, use_json)
186
--> 187 message = payload.get('message', message)
188 errors = payload.get('error', {}).get('errors', ())
189AttributeError: 'bytes' object has no attribute 'get'
This is with gcloud==0.4.1 on Python 3.4.2.
Code to reproduce:
from gcloud import datastore
datastore.set_defaults(dataset_id=123456789)
query = datastore.Query(kind="SomeKind")
list(query.fetch())
Expected behaviour would be for a helpfully worded exception to be thrown.