Implement Retry Upload Error Logic
In this guide, we’ll show you how to set up automatic upload error retry logic in your transcription process.
Upload errors could be a result of a transient issue with our servers or they could be related to an issue with the file itself. Most likely the issue would be that the file is empty. Because the cause can be unclear at first, we recommend adding some retry logic to handle the rare occasions in which our upload service is experiencing performance issues. If the upload failure persists, you’ll want to check whether the file is empty. If you’re unclear on why the file is failing, please reach out to our support team at support@assemblyai.com.
This workflow is designed to automatically retry file uploads if an upload error is encountered.
Quickstart
Get started
Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for a free account and get your API key from your dashboard.
Step-by-step instructions
Install the SDK:
Import the assemblyai
package and assemblyai’s TranscriptError
. Additionally import the and time
package and set your API key:
Create a function that retries upload failures. This example retries up to 3 times with a delay of 5 seconds each time.