Errors
Technical reference of Errores.
Symbols
| Symbol | Class | Description |
|---|---|---|
| ErrUnauthorized | var | ErrUnauthorized it exposes a shared value of the package. |
| ErrForbidden | var | ErrForbidden it exposes a shared value of the package. |
| GoxErrorStage | type | GoxErrorStage defines a public type of API. |
| GoxErrorResolve | const | GoxErrorResolve defines a constant value of the API. |
| GoxErrorCompile | const | GoxErrorCompile defines a constant value of the API. |
| GoxErrorBuild | const | GoxErrorBuild defines a constant value of the API. |
| GoxErrorLoad | const | GoxErrorLoad defines a constant value of the API. |
| GoxErrorDispatch | const | GoxErrorDispatch defines a constant value of the API. |
| GoxErrorPanic | const | GoxErrorPanic defines a constant value of the API. |
| GoxErrorWriter | const | GoxErrorWriter defines a constant value of the API. |
| Error | type | Returns the textual representation of the error. |
| ClusterError | type | ClusterError defines a public type of API. |
| ClusterError.Error | func | Returns the textual representation of the error. |
| ClusterError.Unwrap | func | Returns the underlying error. |
| Cluster | var | Cluster it exposes a shared value of the package. |
| ClusterContext.When | func | Search a previous handler. |
| DispatchClusterError | func | Office DispatchClusterError. |
| GoxSocketErrorCode | type | GoxSocketErrorCode defines a public type of API. |
| GoxSocketHandshakeFailed | const | GoxSocketHandshakeFailed defines a constant value of the API. |
| GoxSocketConnectionFailed | const | GoxSocketConnectionFailed defines a constant value of the API. |
| GoxSocketTransportError | const | GoxSocketTransportError defines a constant value of the API. |
| GoxSocketHandlerFailed | const | GoxSocketHandlerFailed defines a constant value of the API. |
| GoxSocketInvalidState | const | GoxSocketInvalidState 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. |
| GoxSocketEncodeFailed | const | GoxSocketEncodeFailed defines a constant value of the API. |
| GoxSocketBindFailed | const | GoxSocketBindFailed defines a constant value of the API. |
| GoxSocketEventNotFound | const | GoxSocketEventNotFound defines a constant value of the API. |
| GoxSocketArgumentCountMismatch | const | GoxSocketArgumentCountMismatch defines a constant value of the API. |
| GoxSocketArgumentTypeMismatch | const | GoxSocketArgumentTypeMismatch defines a constant value of the API. |
| GoxSocketSessionSaveFailed | const | GoxSocketSessionSaveFailed defines a constant value of the API. |
| GoxSocketSessionTouchFailed | const | GoxSocketSessionTouchFailed defines a constant value of the API. |
| GoxSocketSessionExpired | const | GoxSocketSessionExpired defines a constant value of the API. |
| GoxSocketErrorPhase | type | GoxSocketErrorPhase defines a public type of API. |
| GoxSocketPhaseHandshake | const | GoxSocketPhaseHandshake defines a constant value of the API. |
| GoxSocketPhaseConnection | const | GoxSocketPhaseConnection defines a constant value of the API. |
| GoxSocketPhaseTransport | const | GoxSocketPhaseTransport defines a constant value of the API. |
| GoxSocketPhaseHandler | const | GoxSocketPhaseHandler defines a constant value of the API. |
| GoxSocketPhaseProtocol | const | GoxSocketPhaseProtocol defines a constant value of the API. |
| GoxSocketPhaseSession | const | GoxSocketPhaseSession defines a constant value of the API. |
| GoxSocketError | type | GoxSocketError defines a public type of API. |
| GoxSocketError.Error | func | Returns the textual representation of the error. |
| GoxSocketError.Unwrap | func | Returns the underlying error. |
| NewGoxSocketError | func | Build NewGoxSocketError. |
| ChannelErrorCode | type | ChannelErrorCode defines a public type of API. |
| ChannelInvalidState | const | ChannelInvalidState defines a constant value of the API. |
| ChannelProtocolError | const | ChannelProtocolError defines a constant value of the API. |
| ChannelHandlerFailed | const | ChannelHandlerFailed defines a constant value of the API. |
| ChannelEncodeFailed | const | ChannelEncodeFailed 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. |
| ChannelError.Unwrap | func | Returns the underlying 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. |
ErrUnauthorized
Declaration:
ErrUnauthorized = errors.New("unauthorized") ErrUnauthorized it exposes a shared value of the package.
ErrForbidden
Declaration:
ErrForbidden = errors.New("forbidden") ErrForbidden it exposes a shared value of the package.
GoxErrorStage
Declaration:
type GoxErrorStage string GoxErrorStage defines a public type of API.
GoxErrorResolve
Declaration:
GoxErrorResolve GoxErrorStage = "resolve" GoxErrorResolve defines a constant value of the API.
GoxErrorCompile
Declaration:
GoxErrorCompile GoxErrorStage = "compile" GoxErrorCompile defines a constant value of the API.
GoxErrorBuild
Declaration:
GoxErrorBuild GoxErrorStage = "build" GoxErrorBuild defines a constant value of the API.
GoxErrorLoad
Declaration:
GoxErrorLoad GoxErrorStage = "load" GoxErrorLoad defines a constant value of the API.
GoxErrorDispatch
Declaration:
GoxErrorDispatch GoxErrorStage = "dispatch" GoxErrorDispatch defines a constant value of the API.
GoxErrorPanic
Declaration:
GoxErrorPanic GoxErrorStage = "panic" GoxErrorPanic defines a constant value of the API.
GoxErrorWriter
Declaration:
GoxErrorWriter GoxErrorStage = "writer" GoxErrorWriter defines a constant value of the API.
Error
Declaration:
type Error interface {
error
GetStage() GoxErrorStage
GetRoute() string
GetMethod() string
GetIsAction() bool
GetFile() string
GetLine() int
GetColumn() int
GetGeneratedFile() string
GetPluginPath() string
GetKind() string
GetMessage() string
GetHint() string
GetExpected() string
GetFound() string
GetCause() error
GetStack() string
GetOriginalError() Error
GetStatusCode() int
GetStatusMessage() string
GetDetails() map[string]string
} Returns the textual representation of the error.
ClusterError
Declaration:
type ClusterError struct {
Adapter string
Operation string
Message string
InstanceID string
Cause error
} ClusterError defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Adapter | string | Name of the adapter. |
Operation | string | Operation that made the mistake. |
Message | string | A descriptive message. |
InstanceID | string | Associated identifier. |
Cause | error | underlying error. |
ClusterError.Error
Declaration:
func (err ClusterError) 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 := clusterError.Error() ClusterError.Unwrap
Declaration:
func (err ClusterError) Unwrap() error Returns the underlying error.
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
Unwrap returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
Usage syntax
err := clusterError.Unwrap() Cluster
Declaration:
var Cluster = ClusterContext{events: newServerEventState(), state: newClusterInfoState()} Cluster it exposes a shared value of the package.
ClusterContext.When
Declaration:
func (cluster *ClusterContext) When(event string, handler any) Search a previous handler.
Parameters
| Parameter | Type | Description |
|---|---|---|
event | string | Name of the event. |
handler | any | Type value any required by the operation. |
Usage syntax
clusterContext.When("event", nil) DispatchClusterError
Declaration:
func DispatchClusterError(err ClusterError) Office DispatchClusterError.
Parameters
| Parameter | Type | Description |
|---|---|---|
err | ClusterError | Type value ClusterError required by the operation. |
GoxSocketErrorCode
Declaration:
type GoxSocketErrorCode string GoxSocketErrorCode defines a public type of API.
GoxSocketHandshakeFailed
Declaration:
GoxSocketHandshakeFailed GoxSocketErrorCode = "HANDSHAKE_FAILED" GoxSocketHandshakeFailed defines a constant value of the API.
GoxSocketConnectionFailed
Declaration:
GoxSocketConnectionFailed GoxSocketErrorCode = "CONNECTION_FAILED" GoxSocketConnectionFailed defines a constant value of the API.
GoxSocketTransportError
Declaration:
GoxSocketTransportError GoxSocketErrorCode = "TRANSPORT_ERROR" GoxSocketTransportError defines a constant value of the API.
GoxSocketHandlerFailed
Declaration:
GoxSocketHandlerFailed GoxSocketErrorCode = "HANDLER_FAILED" GoxSocketHandlerFailed defines a constant value of the API.
GoxSocketInvalidState
Declaration:
GoxSocketInvalidState GoxSocketErrorCode = "INVALID_STATE" GoxSocketInvalidState 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.
GoxSocketEncodeFailed
Declaration:
GoxSocketEncodeFailed GoxSocketErrorCode = "ENCODE_FAILED" GoxSocketEncodeFailed defines a constant value of the API.
GoxSocketBindFailed
Declaration:
GoxSocketBindFailed GoxSocketErrorCode = "BIND_FAILED" GoxSocketBindFailed defines a constant value of the API.
GoxSocketEventNotFound
Declaration:
GoxSocketEventNotFound GoxSocketErrorCode = "EVENT_NOT_FOUND" GoxSocketEventNotFound defines a constant value of the API.
GoxSocketArgumentCountMismatch
Declaration:
GoxSocketArgumentCountMismatch GoxSocketErrorCode = "ARGUMENT_COUNT_MISMATCH" GoxSocketArgumentCountMismatch defines a constant value of the API.
GoxSocketArgumentTypeMismatch
Declaration:
GoxSocketArgumentTypeMismatch GoxSocketErrorCode = "ARGUMENT_TYPE_MISMATCH" GoxSocketArgumentTypeMismatch defines a constant value of the API.
GoxSocketSessionSaveFailed
Declaration:
GoxSocketSessionSaveFailed GoxSocketErrorCode = "SESSION_SAVE_FAILED" GoxSocketSessionSaveFailed defines a constant value of the API.
GoxSocketSessionTouchFailed
Declaration:
GoxSocketSessionTouchFailed GoxSocketErrorCode = "SESSION_TOUCH_FAILED" GoxSocketSessionTouchFailed defines a constant value of the API.
GoxSocketSessionExpired
Declaration:
GoxSocketSessionExpired GoxSocketErrorCode = "SESSION_EXPIRED" GoxSocketSessionExpired defines a constant value of the API.
GoxSocketErrorPhase
Declaration:
type GoxSocketErrorPhase string GoxSocketErrorPhase defines a public type of API.
GoxSocketPhaseHandshake
Declaration:
GoxSocketPhaseHandshake GoxSocketErrorPhase = "handshake" GoxSocketPhaseHandshake defines a constant value of the API.
GoxSocketPhaseConnection
Declaration:
GoxSocketPhaseConnection GoxSocketErrorPhase = "connection" GoxSocketPhaseConnection defines a constant value of the API.
GoxSocketPhaseTransport
Declaration:
GoxSocketPhaseTransport GoxSocketErrorPhase = "transport" GoxSocketPhaseTransport defines a constant value of the API.
GoxSocketPhaseHandler
Declaration:
GoxSocketPhaseHandler GoxSocketErrorPhase = "handler" GoxSocketPhaseHandler defines a constant value of the API.
GoxSocketPhaseProtocol
Declaration:
GoxSocketPhaseProtocol GoxSocketErrorPhase = "protocol" GoxSocketPhaseProtocol defines a constant value of the API.
GoxSocketPhaseSession
Declaration:
GoxSocketPhaseSession GoxSocketErrorPhase = "session" GoxSocketPhaseSession defines a constant value of the 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() GoxSocketError.Unwrap
Declaration:
func (err GoxSocketError) Unwrap() error Returns the underlying error.
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
Unwrap returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
Usage syntax
err := goxSocketError.Unwrap() 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.
ChannelInvalidState
Declaration:
ChannelInvalidState ChannelErrorCode = "INVALID_STATE" ChannelInvalidState defines a constant value of the API.
ChannelProtocolError
Declaration:
ChannelProtocolError ChannelErrorCode = "PROTOCOL_ERROR" ChannelProtocolError defines a constant value of the API.
ChannelHandlerFailed
Declaration:
ChannelHandlerFailed ChannelErrorCode = "HANDLER_FAILED" ChannelHandlerFailed defines a constant value of the API.
ChannelEncodeFailed
Declaration:
ChannelEncodeFailed ChannelErrorCode = "ENCODE_FAILED" ChannelEncodeFailed 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() ChannelError.Unwrap
Declaration:
func (err ChannelError) Unwrap() error Returns the underlying error.
Returns
| Return | Type | Description |
|---|---|---|
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
The operation returns an error when it cannot complete the above contract.
Errors
Unwrap returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
Usage syntax
err := channelError.Unwrap() 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.