boostorg / json

A C++11 library for parsing and serializing JSON to and from a DOM container in memory.
https://boost.org/libs/json
Boost Software License 1.0
424 stars 94 forks source link

fix value_to for variants #999

Closed grisumbras closed 3 months ago

grisumbras commented 3 months ago

After we allowed exceptions to propagate through error_code-based conversions (when the user invoked value_to, rather than try_value_to), we inadvertently broke value_to for variants, because they relied on exceptions being caught by try_value_to. This change disables exception propagation for exactly one level of nesting.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.08%. Comparing base (3a7ee79) to head (9f85ed6).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/boostorg/json/pull/999/graphs/tree.svg?width=650&height=150&src=pr&token=HNiMmIjyKi&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg)](https://app.codecov.io/gh/boostorg/json/pull/999?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) ```diff @@ Coverage Diff @@ ## develop #999 +/- ## ======================================== Coverage 93.08% 93.08% ======================================== Files 87 87 Lines 8125 8125 ======================================== Hits 7563 7563 Misses 562 562 ``` | [Files](https://app.codecov.io/gh/boostorg/json/pull/999?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) | Coverage Δ | | |---|---|---| | [include/boost/json/detail/value\_to.hpp](https://app.codecov.io/gh/boostorg/json/pull/999?src=pr&el=tree&filepath=include%2Fboost%2Fjson%2Fdetail%2Fvalue_to.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg#diff-aW5jbHVkZS9ib29zdC9qc29uL2RldGFpbC92YWx1ZV90by5ocHA=) | `100.00% <ø> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/boostorg/json/pull/999?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/boostorg/json/pull/999?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). Last update [3a7ee79...9f85ed6](https://app.codecov.io/gh/boostorg/json/pull/999?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=boostorg).
cppalliance-bot commented 3 months ago

pullrequest Benchmark test results. More info at https://benchmark.cppalliance.org/jsonbenchmarks-pullrequests/999/pullrequest.html