optimizely/optimizely-client-python

parse_response errors return JSONDecodeError

cvolawless opened this issue · 0 comments

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.