Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make prettify more tolerant to missing fields. #7230

Merged
merged 4 commits into from
May 29, 2024

Conversation

yuchenshi
Copy link
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 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
Contributor

@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

CHANGELOG.md Outdated Show resolved Hide resolved
@yuchenshi yuchenshi merged commit cb973d7 into master May 29, 2024
35 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants