Skip to content

Commit

Permalink
Handle 429 error
Browse files Browse the repository at this point in the history
  • Loading branch information
topscoder committed Jun 4, 2024
1 parent 1086996 commit d0b7796
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aisubs.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func generateSubdomains(subdomain, domain, apiKey string, amount string) ([]stri
time.Sleep(20 * time.Second)
continue
}

if strings.Contains(err.Error(), "You exceeded your current quota") {
fmt.Println("You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors")
}

return nil, fmt.Errorf("error generating subdomains: %w", err)
}

Expand Down

0 comments on commit d0b7796

Please sign in to comment.