def _get_error(self, body):
        if 'errors' in body['error']:
            err = body['error']['errors'][0]
        else:
            err = body['error']

        if 'code' in err:
            code = err.get('code')
            message = err.get('message')
        else:
            code = err.get('reason', None)
            message = body.get('error_description', err)

        return (code, message)
Get the error code and message from a JSON response.
dataset/ETHPy150Open apache/libcloud/libcloud/common/google.py/GoogleResponse._get_error