From 49fce3373bed059f041f208db1863cf6184ceeba Mon Sep 17 00:00:00 2001 From: Peter Steneteg Date: Mon, 26 Oct 2020 15:15:16 +0100 Subject: Help: Clarify string(JSON) error handling Closes: #21355 --- Help/command/string.rst | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Help/command/string.rst b/Help/command/string.rst index 0c2f57e..51f8d82 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -491,6 +491,16 @@ JSON Functionality for querying a JSON string. +.. note:: + In each of the following JSON-related subcommands, if the optional + ``ERROR_VARIABLE`` argument is given, errors will be reported in + ```` and the ```` will be set to + ``-[...]-NOTFOUND`` with the path elements + up to the point where the error occurred, or just ``NOTFOUND`` if there + is no relevant path. If an error occurs but the ``ERROR_VARIABLE`` + option is not present, a fatal error message is generated. If no error + occurs, the ```` will be set to ``NOTFOUND``. + .. _GET: .. code-block:: cmake @@ -563,13 +573,6 @@ The contents of ```` should be valid JSON. EQUAL ) Compare the two JSON objects given by ```` and ```` -for equality - - -If the optional ``ERROR_VARIABLE`` argument is given, errors will be -reported in ````. If no error occurs, the ```` -will be set to ``NOTFOUND``. If ``ERROR_VARIABLE`` is not set a CMake error -will be issued. -When an error occurs the ```` will be set to -``-[...]-NOTFOUND`` with the path elements up to -the point where the error occurred. +for equality. The contents of ```` and ```` +should be valid JSON. The ```` will be set to a true value if the +JSON objects are considered equal, or a false value otherwise. -- cgit v0.12