# Is string(JSON) with no ERROR\_VARIABLE supposed to exit with a fatal error if an error occurs?

**URL:** https://discourse.cmake.org/t/is-string-json-with-no-error-variable-supposed-to-exit-with-a-fatal-error-if-an-error-occurs/8463
**Category:** Usage
**Created:** [July 5, 2023, 10:49am UTC](https://discourse.cmake.org/t/is-string-json-with-no-error-variable-supposed-to-exit-with-a-fatal-error-if-an-error-occurs/8463 "2023-07-05T10:49:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![starball](https://discourse.cmake.org/user_avatar/discourse.cmake.org/starball/32/3437_2.png) [@starball](https://discourse.cmake.org/u/starball)
#### Post date: [July 5, 2023, 10:49am UTC](https://discourse.cmake.org/t/is-string-json-with-no-error-variable-supposed-to-exit-with-a-fatal-error-if-an-error-occurs/8463/1 "2023-07-05T10:49:13Z")

</div>

The current behaviour seems to be to issue an error message, but to continue on with the configuration process. The docs state:

> If an error occurs but the `ERROR_VARIABLE` option is not present, a fatal error message is generated. If no error occurs, the `<error-variable>` will be set to `NOTFOUND` .

It’s a bit unclear to me whether the current behaviour of not exiting is by design or not. Could a maintainer please clarify?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [July 9, 2023, 4:48pm UTC](https://discourse.cmake.org/t/is-string-json-with-no-error-variable-supposed-to-exit-with-a-fatal-error-if-an-error-occurs/8463/2 "2023-07-09T16:48:51Z")

</div>

That sounds like an oversight to me. Could you please [file an issue](https://gitlab.kitware.com/cmake/cmake/-/issues).

---

<div class="post-metadata">

### Author: ![starball](https://discourse.cmake.org/user_avatar/discourse.cmake.org/starball/32/3437_2.png) [@starball](https://discourse.cmake.org/u/starball)
#### Post date: [July 10, 2023, 12:04am UTC](https://discourse.cmake.org/t/is-string-json-with-no-error-variable-supposed-to-exit-with-a-fatal-error-if-an-error-occurs/8463/3 "2023-07-10T00:04:18Z")

</div>

Done: [https://gitlab.kitware.com/cmake/cmake/-/issues/25072](https://gitlab.kitware.com/cmake/cmake/-/issues/25072)
