[PR #7241] Display meaningful errors when JSON types don't match #26871

Open
opened 2026-01-31 09:18:37 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/7241

State: closed
Merged: Yes


This pull request completes (and somewhat rewrites) the JsonUtils error
handling arc. Deserialization errors, no longer represented by trees of
exceptions that must be rethrown and caught, are now transformed at
catch time into a message explaining what we expected and where we
expected it.

Instead of exception trees, a deserialization failure will result in a
single type of exception with the originating JSON object from which we
can determine the contents and location of the failure.

Because most of the error message actually comes from the JSON schema
or the actual supported types, and the other jsoncpp errors are not
localized I've made the decision to not localize these messages.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/7241 **State:** closed **Merged:** Yes --- This pull request completes (and somewhat rewrites) the JsonUtils error handling arc. Deserialization errors, no longer represented by trees of exceptions that must be rethrown and caught, are now transformed at catch time into a message explaining what we expected and where we expected it. Instead of exception trees, a deserialization failure will result in a single type of exception with the originating JSON object from which we can determine the contents and location of the failure. Because most of the error message actually comes from the JSON schema or the actual supported types, and the other jsoncpp errors are not localized I've made the decision to **not** localize these messages.
claunia added the pull-request label 2026-01-31 09:18:37 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26871