terminal/src
Mike Griese 99fa9460fd
Gracefully handle json data with the wrong value types (#4961)
## Summary of the Pull Request

Currently, if the Terminal attempts to parse a setting that _should_ be a `bool`
and the user provided a string, then we'll throw an exception while parsing the
settings, and display an error message that's pretty unrelated to the actual
problem.

The same goes for `bool`s as `int`s, `float`s as `int`s, etc.

This PR instead updates our settings parsing to ensure that we check the type of
a json value before actually trying to get its parsed value.

## References

## PR Checklist
* [x] Closes #4299
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

I made a bunch of `JsonUtils` helpers for this in the same vein as the
`GetOptionalValue` ones.

Notably, any other value type can safely be treated as a string value.

## Validation Steps Performed
* added tests
* ran the Terminal and verified we can parse settings with the wrong types
2020-03-20 20:35:51 +00:00
..
buffer hygiene: change default specifiers of some functions to delete (#4962) 2020-03-18 17:30:50 -07:00
cascadia Gracefully handle json data with the wrong value types (#4961) 2020-03-20 20:35:51 +00:00
host Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
inc Add explicit to bool operators of Point and Rect (#4948) 2020-03-19 16:12:15 +00:00
interactivity Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
internal Merged PR 4271163: [Git2Git] Remove use of private theme APIs 2020-02-03 23:13:31 +00:00
propsheet Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
propslib Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
renderer Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
server Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
terminal Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
testlist inbox: Merge accumulated build fixes from RS_ONECORE_DEP_ACIOSS (#1002) 2019-05-24 12:28:30 -07:00
til Add explicit to bool operators of Point and Rect (#4948) 2020-03-19 16:12:15 +00:00
tools Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
tsf Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
types Merge branch 'inbox' into master 2020-03-19 11:17:08 -07:00
winconpty Change NULL to nullptr since they are pointers (#4960) 2020-03-20 20:35:12 +00:00
common.build.post.props Add experimental retro terminal effects (#3468) 2019-12-12 13:44:01 +00:00
common.build.pre.props Introduce chromium safe math (#4144) 2020-01-16 18:51:06 +00:00
common.build.tests.props Update TAEF to 10.51 and remove the private dep on Taef.TestAdapter (#4450) 2020-02-03 22:14:43 +00:00
ConsolePerf.regions.xml Tab to spaces (#578) 2019-05-13 18:06:36 -07:00
ConsolePerf.wprp Fix the WPR profile (#4007) 2019-12-17 17:14:15 -08:00
cppwinrt.build.post.props Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
cppwinrt.build.pre.props Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
dirs Introduce til::some (#4123) 2020-01-09 09:07:52 -08:00
project.inc Import build fix changes from OS for sync to a34a957cf 2020-03-16 18:26:48 +00:00
project.unittest.inc inbox: merge refactoring payload from FI 2019-06-11 17:01:26 -07:00
StaticAnalysis.ruleset Combined changes to make the build work again (see inside) (#2945) 2019-09-30 10:39:55 -07:00
unit.tests.x64.runsettings Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
unit.tests.x86.runsettings Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
wap-common.build.post.props Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
wap-common.build.pre.props Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00