Skip to content

fix: improve typed API error handling#367

Draft
javiermolinar wants to merge 1 commit intomainfrom
fix/error-handling-context-and-404s
Draft

fix: improve typed API error handling#367
javiermolinar wants to merge 1 commit intomainfrom
fix/error-handling-context-and-404s

Conversation

@javiermolinar
Copy link
Copy Markdown
Collaborator

No description provided.

@javiermolinar javiermolinar marked this pull request as draft April 3, 2026 20:45
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec0bf83bdd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/gcx/fail/convert.go
prefix == "failed to get profile types",
prefix == "failed to get series":
return true
case strings.HasPrefix(prefix, "failed to get datasource"):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve datasource UID context in wrapped API errors

The generic-prefix filter now drops any wrapper text that starts with failed to get datasource, but wrappers like failed to get datasource "<uid>": %w include the UID that operators need to identify which datasource failed. For non-404 responses, datasourceErrorSummary does not include Identifier, so this filter removes the only UID context and produces ambiguous errors (especially in auto-discovery/validation flows that query multiple datasources). Please avoid treating prefixed variants with identifiers as generic wrappers.

Useful? React with 👍 / 👎.

Comment on lines +40 to +41
if parsedStatus != 0 {
statusCode = parsedStatus
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not override transport status with embedded query status

FromBody unconditionally replaces the HTTP status code with results.*.status when present. If the envelope status differs from the transport status (for example, auth/proxy failures that still include a downstream error object), this misclassifies the failure and can suppress auth-specific handling like ExitAuthFailure in convertQueryErrors. Keep the transport status as the source of truth and only use embedded status as a fallback.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant