Documentation
¶
Overview ¶
Package errors contains SuperMQ errors definitions.
Index ¶
- Variables
- func Contains(e1, e2 error) bool
- func NewInternalError() error
- func Unwrap(err error) (error, error)
- func Wrap(wrapper, err error) error
- type AuthNError
- type AuthZError
- type Error
- type Handler
- type HandlerOption
- type InternalError
- type Mapper
- type MediaTypeError
- type NestError
- func NewAuthNError(message string) NestError
- func NewAuthNErrorWithErr(message string, err error) NestError
- func NewAuthZError(message string) NestError
- func NewAuthZErrorWithErr(message string, err error) NestError
- func NewInternalErrorWithErr(err error) NestError
- func NewMediaTypeError(message string) NestError
- func NewMediaTypeErrorWithErr(message string, err error) NestError
- func NewNotFoundError(message string) NestError
- func NewNotFoundErrorWithErr(message string, err error) NestError
- func NewRequestError(message string) NestError
- func NewRequestErrorWithErr(message string, err error) NestError
- func NewServiceError(message string) NestError
- func NewServiceErrorWithErr(message string, err error) NestError
- type NotFoundError
- type RequestError
- type SDKError
- type ServiceError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMalformedEntity indicates a malformed entity specification. ErrMalformedEntity = NewRequestError("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") // 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 registered") // 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 = NewRequestError("route not available") )
Functions ¶
func NewInternalError ¶ added in v0.18.4
func NewInternalError() error
Types ¶
type AuthNError ¶ added in v0.18.4
type AuthNError struct {
// contains filtered or unexported fields
}
func (*AuthNError) Embed ¶ added in v0.18.4
func (e *AuthNError) Embed(err error) error
func (*AuthNError) MarshalJSON ¶ added in v0.18.4
type AuthZError ¶ added in v0.18.4
type AuthZError struct {
// contains filtered or unexported fields
}
func (*AuthZError) Embed ¶ added in v0.18.4
func (e *AuthZError) Embed(err error) error
func (*AuthZError) MarshalJSON ¶ added in v0.18.4
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 HandlerOption ¶ added in v0.18.4
type HandlerOption func(*Handler)
type InternalError ¶ added in v0.18.4
type InternalError struct {
// contains filtered or unexported fields
}
func (*InternalError) Embed ¶ added in v0.18.4
func (e *InternalError) Embed(err error) error
func (*InternalError) MarshalJSON ¶ added in v0.18.4
type MediaTypeError ¶ added in v0.18.4
type MediaTypeError struct {
// contains filtered or unexported fields
}
func (*MediaTypeError) Embed ¶ added in v0.18.4
func (e *MediaTypeError) Embed(err error) error
func (*MediaTypeError) MarshalJSON ¶ added in v0.18.4
type NestError ¶ added in v0.18.4
func NewAuthNError ¶ added in v0.18.4
func NewAuthNErrorWithErr ¶ added in v0.18.4
func NewAuthZError ¶ added in v0.18.4
func NewAuthZErrorWithErr ¶ added in v0.18.4
func NewInternalErrorWithErr ¶ added in v0.18.4
func NewMediaTypeError ¶ added in v0.18.4
func NewMediaTypeErrorWithErr ¶ added in v0.18.4
func NewNotFoundError ¶ added in v0.18.4
func NewNotFoundErrorWithErr ¶ added in v0.18.4
func NewRequestError ¶ added in v0.18.4
func NewRequestErrorWithErr ¶ added in v0.18.4
func NewServiceError ¶ added in v0.18.4
func NewServiceErrorWithErr ¶ added in v0.18.4
type NotFoundError ¶ added in v0.18.4
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Embed ¶ added in v0.18.4
func (e *NotFoundError) Embed(err error) error
func (*NotFoundError) MarshalJSON ¶ added in v0.18.4
type RequestError ¶ added in v0.18.4
type RequestError struct {
// contains filtered or unexported fields
}
func (*RequestError) Embed ¶ added in v0.18.4
func (e *RequestError) Embed(err error) error
func (*RequestError) MarshalJSON ¶ added in v0.18.4
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.
type ServiceError ¶ added in v0.18.4
type ServiceError struct {
// contains filtered or unexported fields
}
func (*ServiceError) Embed ¶ added in v0.18.4
func (e *ServiceError) Embed(err error) error
func (*ServiceError) MarshalJSON ¶ added in v0.18.4
Click to show internal directories.
Click to hide internal directories.