[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/13] qapi: nail down convention that Errors sections are lists
From: |
Markus Armbruster |
Subject: |
[PULL 08/13] qapi: nail down convention that Errors sections are lists |
Date: |
Sat, 6 Jul 2024 09:24:11 +0200 |
From: John Snow <jsnow@redhat.com>
By unstated convention, Errors sections are rST lists. Document the
convention, and make the one exception conform.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240626222128.406106-10-jsnow@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
docs/devel/qapi-code-gen.rst | 7 +++++++
qapi/transaction.json | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst
index f453bd3546..cee43222f1 100644
--- a/docs/devel/qapi-code-gen.rst
+++ b/docs/devel/qapi-code-gen.rst
@@ -1011,6 +1011,13 @@ like this::
"Returns" and "Errors" sections are only valid for commands. They
document the success and the error response, respectively.
+"Errors" sections should be formatted as an rST list, each entry
+detailing a relevant error condition. For example::
+
+ # Errors:
+ # - If @device does not exist, DeviceNotFound
+ # - Any other error returns a GenericError.
+
A "Since: x.y.z" tagged section lists the release that introduced the
definition.
diff --git a/qapi/transaction.json b/qapi/transaction.json
index 5749c133d4..07afc269d5 100644
--- a/qapi/transaction.json
+++ b/qapi/transaction.json
@@ -235,7 +235,7 @@
# additional detail.
#
# Errors:
-# Any errors from commands in the transaction
+# - Any errors from commands in the transaction
#
# Note: The transaction aborts on the first failure. Therefore, there
# will be information on only one failed operation returned in an
--
2.45.0
- [PULL 00/13] QAPI patches patches for 2024-07-06, Markus Armbruster, 2024/07/06
- [PULL 02/13] docs/qapidoc: remove unused intersperse function, Markus Armbruster, 2024/07/06
- [PULL 04/13] qapi/parser: preserve indentation in QAPIDoc sections, Markus Armbruster, 2024/07/06
- [PULL 10/13] qapi: update prose in note blocks, Markus Armbruster, 2024/07/06
- [PULL 03/13] docs/qapidoc: delint a tiny portion of the module, Markus Armbruster, 2024/07/06
- [PULL 09/13] qapi: convert "Note" sections to plain rST, Markus Armbruster, 2024/07/06
- [PULL 06/13] docs/qapidoc: fix nested parsing under untagged sections, Markus Armbruster, 2024/07/06
- [PULL 05/13] qapi/parser: fix comment parsing immediately following a doc block, Markus Armbruster, 2024/07/06
- [PULL 11/13] qapi: add markup to note blocks, Markus Armbruster, 2024/07/06
- [PULL 08/13] qapi: nail down convention that Errors sections are lists,
Markus Armbruster <=
- [PULL 13/13] sphinx/qapidoc: Fix to generate doc for explicit, unboxed arguments, Markus Armbruster, 2024/07/06
- [PULL 01/13] qapi: linter fixups, Markus Armbruster, 2024/07/06
- [PULL 07/13] qapi: fix non-compliant JSON examples, Markus Armbruster, 2024/07/06
- [PULL 12/13] qapi/parser: don't parse rST markup as section headers, Markus Armbruster, 2024/07/06
- Re: [PULL 00/13] QAPI patches patches for 2024-07-06, Richard Henderson, 2024/07/08