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

Fix an issue where JsonUtils produces a bad error message #14668

Merged
1 commit merged into from
Jan 13, 2023
Merged

Conversation

DHowett
Copy link
Member

@DHowett DHowett commented Jan 11, 2023

CascadiaSettings relies on getting a JsonUtils::DeserializationException
from the various JSON Utility functions, and then formatting that into
an error message. Well, DeserializationException tries to include an
object representation in its what() message . . . and generates an
exception trying to do so. CascadiaSettings never gets the
DeserializationException, and displays a weird message.

It's safe to remove the stringification in DeserializationException
because CascadiaSettings was never using it (and because
CascadiaSettings was using an even better version of the same logic.)

Fixes #14373

CascadiaSettings relies on getting a JsonUtils::DeserializationException
from the various JSON Utility functions, and then formatting that into
an error message. Well, DeserializationException tries to include an
object representation in its what() message . . . and generates an
exception trying to do so. CascadiaSettings never gets the
DeserializationException, and displays a weird message.

Fixes #14373
@ghost ghost added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Jan 11, 2023
@DHowett
Copy link
Member Author

DHowett commented Jan 11, 2023

Before: bad

After:
image

@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Jan 12, 2023
@DHowett
Copy link
Member Author

DHowett commented Jan 12, 2023

@msftbot merge this in 7 minutes

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 12, 2023
@ghost
Copy link

ghost commented Jan 12, 2023

Hello @DHowett!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Thu, 12 Jan 2023 00:29:46 GMT, which is in 7 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 239b4d1 into main Jan 13, 2023
@ghost ghost deleted the dev/duhowett/14373 branch January 13, 2023 00:43
@microsoft microsoft deleted a comment Jan 13, 2023
DHowett added a commit that referenced this pull request Jan 13, 2023
CascadiaSettings relies on getting a JsonUtils::DeserializationException
from the various JSON Utility functions, and then formatting that into
an error message. Well, DeserializationException tries to include an
object representation in its what() message . . . and generates an
exception trying to do so. CascadiaSettings never gets the
DeserializationException, and displays a weird message.

It's safe to remove the stringification in DeserializationException
because CascadiaSettings was never using it (_and_ because
CascadiaSettings was using an even better version of the same logic.)

Fixes #14373

(cherry picked from commit 239b4d1)
Service-Card-Id: 87568498
Service-Version: 1.16
@ghost
Copy link

ghost commented Jan 24, 2023

🎉Windows Terminal v1.16.1023 (10231 and 10232) has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Jan 24, 2023

🎉Windows Terminal Preview v1.17.1023 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Second It's a PR that needs another sign-off Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON deserializer errors don't render properly when an unexpected object is encountered
3 participants