def METHOD_NAME(self, client, retries=5, **kwargs):
    try:
        response = client.files_upload(**kwargs)
        return response
    except slack.errors.SlackApiError as sae:
        error_code = sae.response.get('error')
        error_status = sae.response.get('status')
        if retries < 1:
            raise sae # no retries left (or none requested)
        if error_code == 'markdown_conversion_failed_because_of_read_failed':
            logger.warning(f'received {error_code} - retrying {retries}')
            return self.METHOD_NAME(client=client, retries=retries-1, **kwargs)
        elif error_status == 503: # Service Unavailable
            logger.warning(
                f"Slack responded with 'Service Unavailable' (503) - retrying ({retries})"
            )
        else:
            raise sae # only retry for known sporadic err