Add callback to command request for error handling

This commit is contained in:
Isaac Freund
2020-05-24 15:18:57 +02:00
parent 9f35984c62
commit 4d68043045
4 changed files with 105 additions and 15 deletions

View File

@ -29,12 +29,10 @@
</description>
<arg name="command" type="array" summary="the command to run as a series
of null-terminated strings"/>
<arg name="callback" type="new_id" interface="zriver_command_callback_v1"
summary="callback object to recieve success/error events"/>
</request>
<enum name="error">
<entry name="invalid_command" value="0" summary="the command is invalid"/>
</enum>
<event name="focus">
<description summary="sent when a view gains focus">
</description>
@ -56,4 +54,27 @@
summary="the current tags of each view on the output"/>
</event>
</interface>
<interface name="zriver_command_callback_v1" version="1">
<description summary="callback object">
Exactly one of the success or failure events will be sent.
</description>
<event name="success">
<description summary="command successful">
Send when the command has been successfully received and validated by
the server and will be carried out.
</description>
</event>
<event name="failure">
<description summary="command failed">
Sent when the command could not be carried out. This could be due to
sending a non-existent command, no command, not enough arguments, too
many arguments, invalid arguments, etc.
</description>
<arg name="failure_message" type="string"
summary="a message explaining why failure occurred"/>
</event>
</interface>
</protocol>