Skip to content

Make prettify more tolerant to missing fields.#7230

Merged
yuchenshi merged 4 commits intomasterfrom
ys/dataconnect-prettify-fix
May 29, 2024
Merged

Make prettify more tolerant to missing fields.#7230
yuchenshi merged 4 commits intomasterfrom
ys/dataconnect-prettify-fix

Conversation

@yuchenshi
Copy link
Copy Markdown
Member

@yuchenshi yuchenshi commented May 28, 2024

Description

Fixes errors like this:

[debug] [2024-05-28T23:02:54.833Z] TypeError: Cannot read properties of undefined (reading 'file')
    at prettify (\some\path\node_modules\firebase-tools\lib\dataconnect\graphqlError.js:7:39)

Scenarios Tested

A customer has encountered this when the error connector source must not contain anonymous operations was thown. The existing code fails during processing, and swallows the actual error. I guess these are indeed without file names or paths for now. We may need to improve the error reporting, but for now, the point is that errors like these do exist.

This PR make sure when it happens again we will see the actual error message.

Sample Commands

firebase deploy

@yuchenshi yuchenshi requested a review from hlshen May 28, 2024 23:51
@yuchenshi yuchenshi enabled auto-merge (squash) May 29, 2024 00:04
@yuchenshi yuchenshi requested a review from joehan May 29, 2024 17:48
@yuchenshi yuchenshi assigned joehan and unassigned hlshen May 29, 2024
Copy link
Copy Markdown
Member

@joehan joehan left a comment

Choose a reason for hiding this comment

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

LGTM

joehan and others added 2 commits May 29, 2024 17:42
@yuchenshi yuchenshi merged commit cb973d7 into master May 29, 2024
@yuchenshi yuchenshi deleted the ys/dataconnect-prettify-fix branch May 29, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants