def check_shock_response(self, response, errtxt):
    if (not response.ok):
        try:
            err = json.loads(response.content)['error'][0]
        except:
            self.log(("Couldn't parse response error content from Shock: " + response.content))
            response.raise_for_status()
        raise ShockException((errtxt + str(err)))
def check_shock_response(self, response, errtxt):
    if (not response.ok):
        try:
            err = json.loads(response.content)['error'][0]
        except:
            self.log(("Couldn't parse response error content from Shock: " + response.content))
            response.raise_for_status()
        raise ShockException((errtxt + str(err)))