WebSocket errors
Technical reference of Errores WebSocket.
This API is used in WebSocket Life Cycle.
Symbols
| Symbol | Class | Description |
|---|---|---|
| GoxSocketErrorCode | type | GoxSocketErrorCode defines a public type of API. |
| GoxSocketTransportError | const | GoxSocketTransportError defines a constant value of the API. |
| GoxSocketConnectionClosed | const | GoxSocketConnectionClosed defines a constant value of the API. |
| GoxSocketProtocolError | const | GoxSocketProtocolError defines a constant value of the API. |
| GoxSocketErrorPhase | type | GoxSocketErrorPhase defines a public type of API. |
| GoxSocketError | type | GoxSocketError defines a public type of API. |
| GoxSocketError.Error | func | Returns the textual representation of the error. |
| NewGoxSocketError | func | Build NewGoxSocketError. |
| ChannelErrorCode | type | ChannelErrorCode defines a public type of API. |
| ChannelProtocolError | const | ChannelProtocolError defines a constant value of the API. |
| ChannelTransportError | const | ChannelTransportError defines a constant value of the API. |
| ChannelError | type | ChannelError defines a public type of API. |
| ChannelError.Error | func | Returns the textual representation of the error. |
| ChannelDisconnectReason | type | ChannelDisconnectReason defines a public type of API. |
| ChannelDisconnectLeft | const | ChannelDisconnectLeft defines a constant value of the API. |
| ChannelDisconnectRemoved | const | ChannelDisconnectRemoved defines a constant value of the API. |
| ChannelDisconnectRejected | const | ChannelDisconnectRejected defines a constant value of the API. |
| ChannelDisconnectSocketDisconnected | const | ChannelDisconnectSocketDisconnected defines a constant value of the API. |
| ChannelDisconnectClosed | const | ChannelDisconnectClosed defines a constant value of the API. |
| ChannelDisconnectServerStopped | const | ChannelDisconnectServerStopped defines a constant value of the API. |
| WSCloseCode | type | WSCloseCode defines a public type of API. |
| WSCloseDefault | const | WSCloseDefault defines a constant value of the API. |
| WSCloseNormal | const | WSCloseNormal defines a constant value of the API. |
| WSCloseGoingAway | const | WSCloseGoingAway defines a constant value of the API. |
| WSCloseProtocol | const | WSCloseProtocol defines a constant value of the API. |
| WSCloseUnsupported | const | WSCloseUnsupported defines a constant value of the API. |
| WSCloseAbnormal | const | WSCloseAbnormal defines a constant value of the API. |
| WSCloseInvalidData | const | WSCloseInvalidData defines a constant value of the API. |
| WSClosePolicy | const | WSClosePolicy defines a constant value of the API. |
| WSCloseMessageLarge | const | WSCloseMessageLarge defines a constant value of the API. |
| WSCloseInternal | const | WSCloseInternal defines a constant value of the API. |
| WSCloseRestart | const | WSCloseRestart defines a constant value of the API. |
| WSCloseTryLater | const | WSCloseTryLater defines a constant value of the API. |
| WSClosePermanent | const | WSClosePermanent defines a constant value of the API. |
| WSCloseReconnect | const | WSCloseReconnect defines a constant value of the API. |
| WSCloseSessionExpired | const | WSCloseSessionExpired defines a constant value of the API. |
| WSCloseSessionDestroyed | const | WSCloseSessionDestroyed defines a constant value of the API. |
| WSCloseReason | func | Returns the default reason for a closing code. |
| WSDisconnectInitiator | type | WSDisconnectInitiator defines a public type of API. |
| WSDisconnectInitiatorClient | const | WSDisconnectInitiatorClient defines a constant value of the API. |
| WSDisconnectInitiatorServer | const | WSDisconnectInitiatorServer defines a constant value of the API. |
| WSDisconnectInitiatorUnknown | const | WSDisconnectInitiatorUnknown defines a constant value of the API. |
| WSDisconnectReason | type | WSDisconnectReason defines a public type of API. |
GoxSocketErrorCode
Declaration:
type GoxSocketErrorCode string GoxSocketErrorCode defines a public type of API.
GoxSocketTransportError
Declaration:
GoxSocketTransportError GoxSocketErrorCode = "TRANSPORT_ERROR" GoxSocketTransportError defines a constant value of the API.
GoxSocketConnectionClosed
Declaration:
GoxSocketConnectionClosed GoxSocketErrorCode = "CONNECTION_CLOSED" GoxSocketConnectionClosed defines a constant value of the API.
GoxSocketProtocolError
Declaration:
GoxSocketProtocolError GoxSocketErrorCode = "PROTOCOL_ERROR" GoxSocketProtocolError defines a constant value of the API.
GoxSocketErrorPhase
Declaration:
type GoxSocketErrorPhase string GoxSocketErrorPhase defines a public type of API.
GoxSocketError
Declaration:
type GoxSocketError struct {
Code GoxSocketErrorCode
Message string
Phase GoxSocketErrorPhase
Event string
Retryable bool
Cause error
EventID uint64
Argument int
Received string
Expected string
Remote bool
} GoxSocketError defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Code | GoxSocketErrorCode | Code that classifies the state. |
Message | string | A descriptive message. |
Phase | GoxSocketErrorPhase | Phase that made the mistake. |
Event | string | Name of the event. |
Retryable | bool | It indicates whether the operation can be retried. |
Cause | error | underlying error. |
EventID | uint64 | Associated identifier. |
Argument | int | Invalid argument index. |
Received | string | Type or value received. |
Expected | string | Expected type or value. |
Remote | bool | It indicates whether the error originated in another instance. |
GoxSocketError.Error
Declaration:
func (err GoxSocketError) Error() string Returns the textual representation of the error.
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := goxSocketError.Error() NewGoxSocketError
Declaration:
func NewGoxSocketError(code GoxSocketErrorCode, message string, phase GoxSocketErrorPhase, event string, retryable bool, cause error) GoxSocketError Build NewGoxSocketError.
Parameters
| Parameter | Type | Description |
|---|---|---|
code | GoxSocketErrorCode | Code of closure. |
message | string | Type value string required by the operation. |
phase | GoxSocketErrorPhase | Type value GoxSocketErrorPhase required by the operation. |
event | string | Name of the event. |
retryable | bool | Type value bool required by the operation. |
cause | error | Type value error required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
value | GoxSocketError | Type value GoxSocketError produced by the operation. |
Usage syntax
value := gox.NewGoxSocketError(200, value, value, "event", value, value) ChannelErrorCode
Declaration:
type ChannelErrorCode string ChannelErrorCode defines a public type of API.
ChannelProtocolError
Declaration:
ChannelProtocolError ChannelErrorCode = "PROTOCOL_ERROR" ChannelProtocolError defines a constant value of the API.
ChannelTransportError
Declaration:
ChannelTransportError ChannelErrorCode = "TRANSPORT_ERROR" ChannelTransportError defines a constant value of the API.
ChannelError
Declaration:
type ChannelError struct {
Code ChannelErrorCode
ChannelID string
Event string
Message string
Retryable bool
Cause error
} ChannelError defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Code | ChannelErrorCode | Code that classifies the state. |
ChannelID | string | Associated identifier. |
Event | string | Name of the event. |
Message | string | A descriptive message. |
Retryable | bool | It indicates whether the operation can be retried. |
Cause | error | underlying error. |
ChannelError.Error
Declaration:
func (err ChannelError) Error() string Returns the textual representation of the error.
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := channelError.Error() ChannelDisconnectReason
Declaration:
type ChannelDisconnectReason string ChannelDisconnectReason defines a public type of API.
ChannelDisconnectLeft
Declaration:
ChannelDisconnectLeft ChannelDisconnectReason = "left" ChannelDisconnectLeft defines a constant value of the API.
ChannelDisconnectRemoved
Declaration:
ChannelDisconnectRemoved ChannelDisconnectReason = "removed" ChannelDisconnectRemoved defines a constant value of the API.
ChannelDisconnectRejected
Declaration:
ChannelDisconnectRejected ChannelDisconnectReason = "rejected" ChannelDisconnectRejected defines a constant value of the API.
ChannelDisconnectSocketDisconnected
Declaration:
ChannelDisconnectSocketDisconnected ChannelDisconnectReason = "socket-disconnected" ChannelDisconnectSocketDisconnected defines a constant value of the API.
ChannelDisconnectClosed
Declaration:
ChannelDisconnectClosed ChannelDisconnectReason = "closed" ChannelDisconnectClosed defines a constant value of the API.
ChannelDisconnectServerStopped
Declaration:
ChannelDisconnectServerStopped ChannelDisconnectReason = "server-stopped" ChannelDisconnectServerStopped defines a constant value of the API.
WSCloseCode
Declaration:
type WSCloseCode int WSCloseCode defines a public type of API.
WSCloseDefault
Declaration:
WSCloseDefault WSCloseCode = 0 WSCloseDefault defines a constant value of the API.
WSCloseNormal
Declaration:
WSCloseNormal WSCloseCode = 1000 WSCloseNormal defines a constant value of the API.
WSCloseGoingAway
Declaration:
WSCloseGoingAway WSCloseCode = 1001 WSCloseGoingAway defines a constant value of the API.
WSCloseProtocol
Declaration:
WSCloseProtocol WSCloseCode = 1002 WSCloseProtocol defines a constant value of the API.
WSCloseUnsupported
Declaration:
WSCloseUnsupported WSCloseCode = 1003 WSCloseUnsupported defines a constant value of the API.
WSCloseAbnormal
Declaration:
WSCloseAbnormal WSCloseCode = 1006 WSCloseAbnormal defines a constant value of the API.
WSCloseInvalidData
Declaration:
WSCloseInvalidData WSCloseCode = 1007 WSCloseInvalidData defines a constant value of the API.
WSClosePolicy
Declaration:
WSClosePolicy WSCloseCode = 1008 WSClosePolicy defines a constant value of the API.
WSCloseMessageLarge
Declaration:
WSCloseMessageLarge WSCloseCode = 1009 WSCloseMessageLarge defines a constant value of the API.
WSCloseInternal
Declaration:
WSCloseInternal WSCloseCode = 1011 WSCloseInternal defines a constant value of the API.
WSCloseRestart
Declaration:
WSCloseRestart WSCloseCode = 1012 WSCloseRestart defines a constant value of the API.
WSCloseTryLater
Declaration:
WSCloseTryLater WSCloseCode = 1013 WSCloseTryLater defines a constant value of the API.
WSClosePermanent
Declaration:
WSClosePermanent WSCloseCode = 4000 WSClosePermanent defines a constant value of the API.
WSCloseReconnect
Declaration:
WSCloseReconnect WSCloseCode = 4001 WSCloseReconnect defines a constant value of the API.
WSCloseSessionExpired
Declaration:
WSCloseSessionExpired WSCloseCode = 4002 WSCloseSessionExpired defines a constant value of the API.
WSCloseSessionDestroyed
Declaration:
WSCloseSessionDestroyed WSCloseCode = 4003 WSCloseSessionDestroyed defines a constant value of the API.
WSCloseReason
Declaration:
func WSCloseReason(code WSCloseCode) string Returns the default reason for a closing code.
Parameters
| Parameter | Type | Description |
|---|---|---|
code | WSCloseCode | Code of closure. |
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := gox.WSCloseReason(gox.WSCloseNormal) WSDisconnectInitiator
Declaration:
type WSDisconnectInitiator string WSDisconnectInitiator defines a public type of API.
WSDisconnectInitiatorClient
Declaration:
WSDisconnectInitiatorClient WSDisconnectInitiator = "client" WSDisconnectInitiatorClient defines a constant value of the API.
WSDisconnectInitiatorServer
Declaration:
WSDisconnectInitiatorServer WSDisconnectInitiator = "server" WSDisconnectInitiatorServer defines a constant value of the API.
WSDisconnectInitiatorUnknown
Declaration:
WSDisconnectInitiatorUnknown WSDisconnectInitiator = "unknown" WSDisconnectInitiatorUnknown defines a constant value of the API.
WSDisconnectReason
Declaration:
type WSDisconnectReason struct {
Code WSCloseCode
Reason string
Clean bool
Initiator WSDisconnectInitiator
WillReconnect bool
} WSDisconnectReason defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Code | WSCloseCode | Code that classifies the state. |
Reason | string | Associated reason. |
Clean | bool | It indicates whether the closure completed the handshake. |
Initiator | WSDisconnectInitiator | Part that started the disconnection. |
WillReconnect | bool | It indicates whether there will be automatic reconnection. |