optimizely / optimizely-client-python

Optimizely's Python client library is an interface to its REST API.
MIT License
20 stars 12 forks source link

parse_response errors return JSONDecodeError #4

Closed cvolawless closed 9 years ago

cvolawless commented 9 years ago

When I place a response using an invalid api key, I get a JSONDecodeError as you try to return exceptions.

client = optimizely.Client('123')
project = client.Projects.get()

Returns JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Think you want to replace resp.json().get('message') with resp.text when raising those errors.