Skip to content

fix(cmdutil): recognize gofalcon typed error responses in HandleAPIError - #57

Merged
redhatrises merged 1 commit into
CrowdStrike:mainfrom
redhatrises:fix/api-error-status-codes
Dec 3, 2026
Merged

redhatrises merged 1 commit into
CrowdStrike:mainfrom
redhatrises:fix/api-error-status-codes

Conversation

@redhatrises

Copy link
Copy Markdown
Contributor

gofalcon returns generated typed errors (e.g. CspmEvaluationsIomQueriesForbidden) for status codes documented in the API spec, and only falls back to *runtime.APIError for undocumented ones. HandleAPIError only matched the latter, so most 401/403/429/5xx responses printed raw gofalcon text instead of the missing-scope and retry hints.

Add StatusCode, which reads the code from either form via the Code() int method, and use it in HandleAPIError.

gofalcon returns generated typed errors (e.g. CspmEvaluationsIomQueriesForbidden)
for status codes documented in the API spec, and only falls back to
*runtime.APIError for undocumented ones. HandleAPIError only matched the
latter, so most 401/403/429/5xx responses printed raw gofalcon text instead
of the missing-scope and retry hints.

Add StatusCode, which reads the code from either form via the Code() int
method, and use it in HandleAPIError.
@redhatrises
redhatrises merged commit 90d5bf6 into CrowdStrike:main Dec 3, 2026
7 checks passed
@redhatrises
redhatrises deleted the fix/api-error-status-codes branch December 3, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants