Correct Protocol Errors extension - add ok variable

This commit is contained in:
ChronosX88 2019-12-16 17:14:18 +04:00
parent 70f490c72e
commit 4e0c4b1d11
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A
2 changed files with 9 additions and 2 deletions

View File

@ -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"
}
}
}

View File

@ -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)",