diff --git a/protocol-spec/json-schema/BaseMessage.schema.json b/protocol-spec/json-schema/BaseMessage.schema.json index 30ce414..343b1db 100644 --- a/protocol-spec/json-schema/BaseMessage.schema.json +++ b/protocol-spec/json-schema/BaseMessage.schema.json @@ -62,6 +62,12 @@ "type": "object", "title": "payload", "description": "Message payload (used to store extra information in message, list of permissible fields in the payload depends on \"type\" field)" + }, + "ok": { + "$id": "#/properties/ok", + "type": "boolean", + "title": "ok", + "description": "Indicating whether request have an error" } } } diff --git a/protocol-spec/protocol-errors.md b/protocol-spec/protocol-errors.md index a9c52c3..159e18f 100644 --- a/protocol-spec/protocol-errors.md +++ b/protocol-spec/protocol-errors.md @@ -1,7 +1,7 @@ # Protocol Errors ## Introduction Mechanism of error processing included into protocol. -Adds into any type ID `:error` postfix. +Adds into any response message `ok` variable. If `ok` is true - we have no errors, if `ok` is false - we have an error. ## Message type identifiers - `*:error` @@ -24,9 +24,10 @@ Adds into any type ID `:error` postfix. ```json { "id": "abcd", - "type": "incorrectMessageType:error", + "type": "incorrectMessageType", "from": "cadmium.im", "to": "@juliet@cadmium.im", + "ok": false, "payload": { "errCode": 0, "errText": "Incorrect type of message (type isn't implemented in the server)",