Documentation
¶
Overview ¶
Package errors contains SuperMQ errors definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMalformedEntity indicates a malformed entity specification. ErrMalformedEntity = New("malformed entity specification") // ErrUnsupportedContentType indicates invalid content type. ErrUnsupportedContentType = New("invalid content type") // ErrUnidentified indicates unidentified error. ErrUnidentified = New("unidentified error") // ErrEmptyPath indicates empty file path. ErrEmptyPath = New("empty file path") // ErrStatusAlreadyAssigned indicated that the client or group has already been assigned the status. ErrStatusAlreadyAssigned = New("status already assigned") // ErrRollbackTx indicates failed to rollback transaction. ErrRollbackTx = New("failed to rollback transaction") // ErrAuthentication indicates failure occurred while authenticating the entity. ErrAuthentication = New("failed to perform authentication over the entity") // ErrAuthorization indicates failure occurred while authorizing the entity. ErrAuthorization = New("failed to perform authorization over the entity") // ErrMissingDomainMember indicates member is not part of a domain. ErrMissingDomainMember = New("member id is not member of domain") // ErrMissingMember indicates member is not found. ErrMissingMember = New("member id is not found") // ErrEmailAlreadyExists indicates that the email id already exists. ErrEmailAlreadyExists = New("email id already exists") // ErrUsernameNotAvailable indicates that the username is not available. ErrUsernameNotAvailable = New("username not available") // ErrDomainRouteNotAvailable indicates that the domain route is not available. ErrDomainRouteNotAvailable = New("domain route not available") // ErrChannelRouteNotAvailable indicates that the channel route is not available. ErrChannelRouteNotAvailable = New("channel route not available") // ErrTryAgain indicates to try the operation again. ErrTryAgain = New("Something went wrong, please try again") // ErrRouteNotAvailable indicates that the username is not available. ErrRouteNotAvailable = New("route not available") )
Functions ¶
Types ¶
type Error ¶
type Error interface {
// Error implements the error interface.
Error() string
// Msg returns error message.
Msg() string
// Err returns wrapped error.
Err() Error
// MarshalJSON returns a marshaled error.
MarshalJSON() ([]byte, error)
}
Error specifies an API that must be fullfiled by error type.
type SDKError ¶
SDKError is an error type for SuperMQ SDK.
func CheckError ¶
CheckError will check the HTTP response status code and matches it with the given status codes. Since multiple status codes can be valid, we can pass multiple status codes to the function. The function then checks for errors in the HTTP response.
func NewSDKError ¶
NewSDKError returns an SDK Error that formats as the given text.
func NewSDKErrorWithStatus ¶
NewSDKErrorWithStatus returns an SDK Error setting the status code.
Click to show internal directories.
Click to hide internal directories.