Skip to content

Commit

Permalink
added more error checks in analyzer code
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelalam committed Feb 28, 2025
1 parent 25c36ac commit 838a1ef
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/analyzer/analyzers/airtable/airtablepat/airtable.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analy
return nil, err
}
// If bases are fetched, determine the token scopes
determineScopes(token, basesInfo)
err := determineScopes(token, basesInfo)
if err != nil {
return nil, err
}
}

return mapToAnalyzerResult(userInfo, basesInfo), nil
Expand All @@ -80,7 +83,11 @@ func AnalyzeAndPrintPermissions(cfg *config.Config, token string) {
return
}
basesInfo, _ = common.FetchAirtableBases(token)
determineScopes(token, basesInfo)
err := determineScopes(token, basesInfo)
if err != nil {
color.Red("[x] Error : %s", err.Error())
return
}
}

color.Green("[!] Valid Airtable Personal Access Token\n\n")
Expand Down

0 comments on commit 838a1ef

Please sign in to comment.