Documentation ¶
Overview ¶
Package errors contains Magistrala 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 = errors.New("invalid content type") // ErrUnidentified indicates unidentified error. ErrUnidentified = errors.New("unidentified error") // ErrEmptyPath indicates empty file path. ErrEmptyPath = errors.New("empty file path") // ErrStatusAlreadyAssigned indicated that the client or group has already been assigned the status. ErrStatusAlreadyAssigned = errors.New("status already assigned") // ErrRollbackTx indicates failed to rollback transaction. ErrRollbackTx = errors.New("failed to rollback transaction") // ErrAuthentication indicates failure occurred while authenticating the entity. ErrAuthentication = errors.New("failed to perform authentication over the entity") // ErrAuthorization indicates failure occurred while authorizing the entity. ErrAuthorization = errors.New("failed to perform authorization over the entity") )
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 Magistrala 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.