def surge_handler(response, **kwargs):
    """Error Handler to surface 409 Surge Conflict errors.

    Attached as a callback hook on the Request object.

    Parameters
        response (requests.Response)
            The HTTP response from an API request.
        **kwargs
            Arbitrary keyword arguments.
    """
    if response.status_code == codes.conflict:
        json = response.json()
        errors = json.get('errors', [])
        error = errors[0] if errors else json.get('error')

        if error and error.get('code') == 'surge':
            raise SurgeError(response)

    return response