goog.net.WebChannel.ErrorStatus
Provided By | |
---|---|
Type | number |
WebChannel level error conditions.
Summary of error debugging and reporting in WebChannel:
Network Error
- By default the webchannel library will set the error status to NETWORK_ERROR when a channel has to be aborted or closed. NETWORK_ERROR may be recovered by the application by retrying and opening a new channel.
- There may be lost messages (not acked by the server) when a channel is aborted. Currently we don't have a public API to retrieve messages that are waiting to be acked on the client side. File a bug if you think it is useful to expose such an API.
- Details of why a channel fails are available via closure debug logs, and stats events (see webchannel/requeststats.js). Those are internal stats and are subject to change. File a bug if you think it's useful to version and expose such stats as part of the WebChannel API.
Server Error
- SERVER_ERROR is intended to indicate a non-recoverable condition, e.g. when auth fails.
- We don't currently generate any such errors, because most of the time it's the responsibility of upper-layer frameworks or the application itself to indicate to the client why a webchannel has been failed by the server.
- When a channel is failed by the server explicitly, we still signal NETWORK_ERROR to the client. Explicit server failure may happen when the server does a fail-over, or becomes overloaded, or conducts a forced shutdown etc.
- We use some heuristic to decide if the network (aka cloud) is down v.s. the actual server is down.
RuntimeProperties.getLastStatusCode is a useful state that we expose to the client to indicate the HTTP response status code of the last HTTP request initiated by the WebChannel client library, for debugging purposes only.
See WebChannel.Options.backChannelFailureRecovery and WebChannel.FailureRecovery to install a custom failure-recovery algorithm.
Values
NETWORK_ERROR | Communication to the server has failed. |
---|---|
OK | No error has occurred. |
SERVER_ERROR | The server fails to accept or process the WebChannel. |