Просмотр исходного кода

qapi: nail down convention that Errors sections are lists

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>
John Snow 1 год назад
Родитель
Сommit
b32a6b62a8
2 измененных файлов с 8 добавлено и 1 удалено
  1. 7 0
      docs/devel/qapi-code-gen.rst
  2. 1 1
      qapi/transaction.json

+ 7 - 0
docs/devel/qapi-code-gen.rst

@@ -1011,6 +1011,13 @@ like this::
 "Returns" and "Errors" sections are only valid for commands.  They
 "Returns" and "Errors" sections are only valid for commands.  They
 document the success and the error response, respectively.
 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
 A "Since: x.y.z" tagged section lists the release that introduced the
 definition.
 definition.
 
 

+ 1 - 1
qapi/transaction.json

@@ -235,7 +235,7 @@
 #     additional detail.
 #     additional detail.
 #
 #
 # Errors:
 # 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
 # Note: The transaction aborts on the first failure.  Therefore, there
 #     will be information on only one failed operation returned in an
 #     will be information on only one failed operation returned in an