Documentation ¶
Overview ¶
Package errors ...
Package errors ...
Index ¶
Constants ¶
const ( // BaseVersion defines the latest version of Base BaseVersion = "Base.1.13.0." // InsufficientPrivileges defines the status message at the time of Insufficient Privileges InsufficientPrivileges = BaseVersion + "InsufficientPrivilege" // InternalError defines the status message at the time of Internal Error InternalError = BaseVersion + "InternalError" // PropertyMissing defines the status message at the time of Property Missing PropertyMissing = BaseVersion + "PropertyMissing" // ResourceNotFound defines the status message at the time of Resource Not Found ResourceNotFound = BaseVersion + "ResourceNotFound" // MalformedJSON defines the status message at the time of Malformed JSON MalformedJSON = BaseVersion + "MalformedJSON" // ResourceCannotBeModified defines the status message at the time of Resource Cannot Be Modified ResourceCannotBeModified = BaseVersion + "ResourceCannotBeModified" // PropertyValueNotInList defines the status message at the time of Property Value Not In List PropertyValueNotInList = BaseVersion + "PropertyValueNotInList" // NoValidSession defines the status message at the time of No Valid Session NoValidSession = BaseVersion + "NoValidSession" UnauthorizedLoginAttempt = BaseVersion + "UnauthorizedLoginAttempt" Unauthorized = BaseVersion + "Unauthorized" // ResourceInUse defines events aleady subscribed ResourceInUse = BaseVersion + "ResourceInUse" // PropertyValueFormatError defines the status message given the correct value type but the value of that property was not supported PropertyValueFormatError = BaseVersion + "PropertyValueFormatError" ResourceAtURIUnauthorized = BaseVersion + "ResourceAtUriUnauthorized" // CouldNotEstablishConnection defines the connection failure with plugin or other resources CouldNotEstablishConnection = BaseVersion + "CouldNotEstablishConnection" // ResourceCannotBeDeleted defines the status message at the time of Resource deletion ResourceCannotBeDeleted = BaseVersion + "ResourceCannotBeDeleted" )
const (
// SystemNotSupportedErrString is used for matching unsupported server error
SystemNotSupportedErrString = "computer system is not supported"
)
constants defined for matching partial strings in error returned
Variables ¶
This section is empty.
Functions ¶
func CreateErrResp ¶
CreateErrResp defines the creation of the error message response body without exteneded info
func CreateErrorResponse ¶
CreateErrorResponse defines the creation of the error message response body. As input the fuction takes status message and the error message and will create the response according to statusMessage
Types ¶
type CommonError ¶
type CommonError struct {
Error ErrorClass `json:"error"`
}
CommonError struct definition
type ErrType ¶
type ErrType int
ErrType defines the error type
const ( // UndefinedErrorType to be used when error type is of no significance to the caller UndefinedErrorType ErrType = iota + 1 // DBKeyFetchFailed indicates DB read action failed DBKeyFetchFailed // DBKeyNotFound indicates DB read failure of non-existent key DBKeyNotFound // DBKeyAlreadyExist indicates failure for DB insert of already existing key DBKeyAlreadyExist // DBConnFailed indicates failure to establish connection with DB DBConnFailed // InvalidAuthToken indicates presented authentication token is invalid InvalidAuthToken // JSONUnmarshalFailed indicates JSON unmarshaling of data failed JSONUnmarshalFailed // DecryptionFailed indicates decryption of data failed DecryptionFailed // DBUpdateFailed indicates failure in updating DB DBUpdateFailed // TransactionPartialFailure indicates some of the operations in transaction failed TransactionPartiallyFailed // TimeoutError indicates that the operation is canceled as timeout error occurred. TimeoutError )
enum defined for error types
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error contains the error number and error string Error number to be used for comparision of error type instead of error string
func PackError ¶
PackError defines creation of error response, which packs relevant error number and the error message
func (*Error) GetAuthStatusCodeAndMessage ¶
GetAuthStatusCodeAndMessage will return suitable status code status message for failures
type ErrorClass ¶
type ErrorClass struct { Code string `json:"code"` Message string `json:"message"` MessageExtendedInfo []MsgExtendedInfo `json:"@Message.ExtendedInfo,omitempty"` }
ErrorClass struct definition
type MsgExtendedInfo ¶
type MsgExtendedInfo struct { OdataType string `json:"@odata.type,omitempty"` MessageID string `json:"MessageId,omitempty"` Message string `json:"Message,omitempty"` Severity string `json:"Severity,omitempty"` Resolution string `json:"Resolution,omitempty"` }
MsgExtendedInfo struct definition