Skip to content

Commit

Permalink
DOCS, Streaming: Error handling part of the docs was rewritten
Browse files Browse the repository at this point in the history
  • Loading branch information
s-kostyuk committed May 12, 2018
1 parent 279c39e commit 5f549c7
Showing 1 changed file with 40 additions and 37 deletions.
77 changes: 40 additions & 37 deletions docs/source/api/handling_errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,27 @@ defined above. All errors with identifiers starting from ``5000``
and to ``5999`` including are considered as Streaming API-specific
errors.

Error 5000: Invalid frame type

Error 5000: Timeout
^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to use a Streaming API.
It may indicate that:

- the server was expected to receive a message from a client in the
specified time window but such message wasn't sent.

This error indicates some issue with the client-side code and should
be fixed by client's developer. In some situations server may wait a
message from a client application in the specified time window (not later
than X time units after some point of time). For example, the client
must to send Authentication message not later than 20 seconds from
the connection establishment (as defined in :doc:`./streaming_api`
section of documentation). You must to send messages in the specified
time windows, otherwise you will receive this (5002) error.


Error 5001: Invalid frame type
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to send a frame using a Streaming API.
Expand All @@ -405,7 +425,7 @@ objects and interpreted as Streaming API Messages. You must not to use
binary frames or any other frames for transferring Streaming API Messages.


Error 5001: Invalid frame content
Error 5002: Invalid frame content
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to send a frame using a Streaming API.
Expand All @@ -418,29 +438,30 @@ be fixed by client's developer. For now all the messages passed via
Streaming API must to be encoded as JSON objects according to the rules
defined in :doc:`./streaming_api` section of documentation. You must to
encode Messages as JSON objects and transfer them in TEXT WebSocket frames.
Otherwise the mentioned (5001) error will be thrown.
Otherwise the mentioned (5002) error will be thrown.


Error 5002: Timeout
^^^^^^^^^^^^^^^^^^^
Error 5003: Message format violation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to use a Streaming API.
This error can be thrown on attempts to send a message using a Streaming API.
It may indicate that:

- the server was expected to receive a message from a client in the
specified time window but such message wasn't sent.
- the received message is a valid JSON object is not a valid Message object;
- some fields of Message are missing or have an appropriate type.

This error indicates some issue with the client-side code and should
be fixed by client's developer. In some situations server may wait a
message from a client application in the specified time window (not later
than X time units after some point of time). For example, the client
must to send Authentication message not later than 20 seconds from
the connection establishment (as defined in :doc:`./streaming_api`
section of documentation). You must to send messages in the specified
time windows, otherwise you will receive this (5002) error.
be fixed by client's developer. For now all the messages passed via
Streaming API must to be encoded as JSON objects according to the rules
defined in :doc:`./streaming_api` section of documentation. You must to
encode Messages as JSON objects and transfer them in TEXT WebSocket frames.
Otherwise the mentioned (5003) error will be thrown.

The name of erroneous field is specified in ``devel_message`` field of Error
message.


Error 5003: Invalid message type (not Control)
Error 5010: Invalid message type (not Control)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to use a Streaming API.
Expand All @@ -459,7 +480,7 @@ to send messages with a type, appropriate to the current situation,
otherwise you will receive this (5003) error.


Error 5004: Invalid message type (not Data)
Error 5011: Invalid message type (not Data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to use a Streaming API.
Expand All @@ -478,7 +499,7 @@ to send messages with a type, appropriate to the current situation,
otherwise you will receive this (5004) error.


Error 5010: Invalid message topic
Error 5020: Invalid message topic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to use a Streaming API.
Expand All @@ -498,25 +519,7 @@ topic is expected in the current situation, please refer to the
of a message is defined in ``devel_message`` field of Error message.


Error 5020: Invalid message body
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to use a Streaming API.
It may indicate that:

- the server received a message from a client with a ``body`` field
missing or a body field value that is not a mapping.

This error indicates some issue with the client-side code and should
be fixed by client's developer. For now all the Messages transferred
using Streaming API must to contain a ``body`` field which value is
a JSON mapping (dict). Whereas the described mapping can be empty,
you must to preserve a ``body`` field in all transferred messages and
it must to be a mapping, as defined in the :doc:`./streaming_api`
section of documentation.


Error 5020: Invalid message body content
Error 5030: Invalid message body content
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error can be thrown on attempts to use a Streaming API.
Expand Down

0 comments on commit 5f549c7

Please sign in to comment.