Skip to content

Commit f77f276

Browse files
committed
fix a rate limiting error
1 parent 4d38c89 commit f77f276

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/app/search_api.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ func SearchWithAPI(queries []string) {
5151
if err != nil {
5252
if strings.Contains(err.Error(), "401") {
5353
color.Red("[!] Invalid GitHub access token. Please check that your token is correct and has the necessary permissions.")
54+
os.Exit(1)
55+
} else if strings.Contains(err.Error(), "403") && strings.Contains(err.Error(), "rate reset in") {
56+
color.Yellow("[!] Rate limited by GitHub. Scans may be slower...")
5457
} else {
5558
color.Red("[!] Error authenticating with GitHub: %v", err)
59+
os.Exit(1)
5660
}
57-
os.Exit(1)
5861
}
5962

6063
if !GetFlags().ResultsOnly && !GetFlags().JsonOutput && GetFlags().Debug {

0 commit comments

Comments
 (0)