Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors GraphQL error handling in the Data Connect API client by introducing a new helper function, formatGraphqlErrors, which formats errors and appends debugDetails when available. It also adds support for parsing and formatting GraphQL errors from non-200 HTTP responses, backed by comprehensive unit tests. The reviewer suggested using optional chaining within the formatting helper to prevent potential runtime crashes if malformed error objects are received.
mtr002
force-pushed
the
fix/data-connect-debug-details
branch
from
September 14, 2026 23:33
51ab466 to
fd4045c
Compare
yuchenshi
reviewed
Sep 15, 2026
yuchenshi
approved these changes
Sep 15, 2026
mtr002
force-pushed
the
fix/data-connect-debug-details
branch
from
September 15, 2026 03:02
fd4045c to
3fbc7ce
Compare
mtr002
marked this pull request as ready for review
September 15, 2026 03:04
yuchenshi
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a Data Connect operation fails server-side (e.g., SQL runtime error or connection quota issues), the backend returns a generic
message: "SQL execution failed"alongside detailed diagnostics inextensions.debugDetails.Currently,
DataConnectApiClient.makeGqlRequestextracts onlyerror.message, completely discardingextensions.debugDetails. As a result, standard Node.js logging only surfaces"SQL execution failed"with no actionable cause.Issue: firebase/firebase-tools#11068
Changes
DataConnectApiClient.makeGqlRequest, format GraphQL errors to appenderror.extensions.debugDetailstoerror.messagewhen present.DataConnectApiClient.toFirebaseError, formatdata.errorswhen present on non-200 HTTP responses rather than falling back to"Unknown server error".FirebaseDataConnectErrorremains unchanged.Testing
data-connect-api-client-internal.spec.tsfor:extensions.debugDetails.;.npm run lintandnpm test.