def from_response(raw_response):
        """The Yelp Fusion API returns error messages with a json body
        like:
        {
            'error': {
                'code': 'ALL_CAPS_CODE',
                'description': 'Human readable description.'
            }
        }

        Some errors may have additional fields. For example, a
        validation error:
        {
            'error': {
                'code': 'VALIDATION_ERROR',
                'description': "'en_USS' does not match '^[a-z]{2,3}_[A-Z]{2}$'",
                'field': 'locale',
                'instance': 'en_USS'
            }
        }
        """
        json_response = raw_response.json()
        error_info = json_response["error"]
        code = error_info["code"]

        try:
            error_cls = _error_map[code]
        except KeyError:
            raise NotImplementedError(
                "Unknown error code '{}' returned in Yelp API response. "
                "This code may have been newly added. Please ensure you are "
                "using the latest version of the yelp-python library, and if "
                "so, create a new issue at https://github.com/Yelp/yelp-python "
                "to add support for this error.".format(code)
            )
        else:
            return error_cls(raw_response, **error_info)