Skip to content

fix(gui): extract nested messages from structured API errors#13014

Open
hopstreax wants to merge 1 commit into
continuedev:mainfrom
hopstreax:fix/gemini-quota-error-12945
Open

fix(gui): extract nested messages from structured API errors#13014
hopstreax wants to merge 1 commit into
continuedev:mainfrom
hopstreax:fix/gemini-quota-error-12945

Conversation

@hopstreax

Copy link
Copy Markdown

Description

Fixes #12945.

This PR improves structured API error parsing in the GUI by extracting nested error.message values instead of displaying the entire stringified error object.

Previously, when providers returned structured error payloads (such as Gemini's HTTP 429 quota-exceeded response), the View error output section displayed raw JSON (for example, {"message":"...","status":"RESOURCE_EXHAUSTED"}) rather than the provider's human-readable error message.

This change updates the error parser to:

  • Extract and display the nested error.message when present.
  • Preserve the existing behavior for primitive error values, malformed JSON, top-level message fields, and structured error objects without a message field.
  • Keep the existing HTTP status code extraction and provider-specific error handling unchanged.

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

Since reproducing the original issue requires exceeding the Gemini API quota, I wasn't able to capture a runtime screenshot.

Instead, I verified the fix by simulating the original error payload reported in the issue.

Before

{"message":"You exceeded your current quota for Gemini API in your project. Please check your plan and billing details.","status":"RESOURCE_EXHAUSTED"}

After

You exceeded your current quota for Gemini API in your project. Please check your plan and billing details.

Tests

  • Updated the existing tests for structured nested error parsing.
  • Added regression tests covering:
    • Structured error objects with a nested message
    • Structured error objects without a message
    • Primitive string errors
    • Top-level message fields
    • Malformed JSON
  • Simulated the original Gemini quota-exceeded payload from Issue Error: Gemini 2.5 Pro - Unknown error #12945 and verified that:
    • The parser extracts the human-readable error message.
    • HTTP status code extraction (429) remains unchanged.
  • Verified that all errorAnalysis tests pass successfully.

@hopstreax
hopstreax requested a review from a team as a code owner July 23, 2026 06:45
@hopstreax
hopstreax requested review from sestinj and removed request for a team July 23, 2026 06:45
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@hopstreax

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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.

Error: Gemini 2.5 Pro - Unknown error

1 participant