Check for errors in the response and return the resulting JSON.

def get_dict_from_response(response):
    """Check for errors in the response and return the resulting JSON."""
    if getattr(response, '_resp') and response._resp.code > 400:
        raise OAuthResponseError(
                'Application mis-configuration in Globus', None, response
            )

    return response.data