Documentation ¶
Index ¶
- Constants
- type Error
- func CreateError(err error, code ErrorCode, msg string) Error
- func Errorf(code ErrorCode, fmt string, args ...interface{}) Error
- func GetError(err error) (Error, bool)
- func New(code ErrorCode, msg string) Error
- func WithMessage(code ErrorCode, err error, msg string) Error
- func Wrap(code ErrorCode, cause error, msg string) Error
- func Wrapf(code ErrorCode, cause error, fmt string, args ...interface{}) Error
- type ErrorCode
Constants ¶
View Source
const ( // PanicError will wrap snap panic into an error. Snap will try to handle panic by returning "panic-error" code to the caller. // The cause of panic will be logged as error in the snap log. PanicError = "panic-error" // SystemError ... SystemError = "system-error" // GeneralError ... GeneralError ErrorCode = "general-error" // MissingRequiredParameterError is returned when the caller does not provide required parameters for the call MissingRequiredParameterError = "missing-required-parameter" // ValidationError is usually caused by 'bad' data that is provided by the caller (e.g. invalid URL format) ValidationError ErrorCode = "validation-error" // InitializeConfigError ... InitializeConfigError = "initialize-config-error" // InitializeLoggingError ... InitializeLoggingError = "initialize-logging-error" // MissingConfigDataError ... MissingConfigDataError ErrorCode = "missing-config-data-error" // InvalidConfigDataError ... InvalidConfigDataError ErrorCode = "invalid-config-data-error" // CryptoConfigError ... CryptoConfigError ErrorCode = "crypto-config-error" // CryptoError ... CryptoError ErrorCode = "crypto-error" // ParseCertError ... ParseCertError ErrorCode = "parse-cert-error" // ImportKeyError ... ImportKeyError ErrorCode = "import-key-error" // GetKeyError ... GetKeyError ErrorCode = "get-key-error" // UnmarshalError ... UnmarshalError ErrorCode = "unmarshal-error" // InvalidFunctionError ... InvalidFunctionError ErrorCode = "invalid-function-error" // InitializeSnapError ... InitializeSnapError ErrorCode = "initialize-snap-error" // PeerConfigError ... PeerConfigError = "peer-config-error" // ACLCheckError ... ACLCheckError = "acl-check-error" // MembershipError ... (errors from getAllPeers and getPeersOfChannel) MembershipError = "membership-error" // InvalidConfigMessage ... InvalidConfigMessage = "invalid-config-message" // InvalidPeerConfig ... InvalidPeerConfig = "invalid-peer-config" // InvalidAppConfig ... InvalidAppConfig = "invalid-app-config" // InvalidComponentConfig .... InvalidComponentConfig = "invalid-component-config" // InvalidConfigKey ... InvalidConfigKey = "invalid-config-key" // GetConfigError ... GetConfigError = "get-config-error" // HTTPClientError ... HTTPClientError ErrorCode = "http-client-error" // InvalidCertPinError ... InvalidCertPinError ErrorCode = "invalid-cert-pin-error" // EndorseTxError ... EndorseTxError = "endorse-tx-error" // CommitTxError ... CommitTxError = "commit-tx-error" // InvalidCreatorError ... InvalidCreatorError = "invalid-creator-error" // InvalidSignatureError ... InvalidSignatureError = "invalid-signature-error" // GetTxServiceError ... GetTxServiceError = "get-tx-service-error" // TxClientInitError ... TxClientInitError = "tx-client-init-error" // DataNotFoundError ... DataNotFoundError = "data-not-found-error" // AccessDeniedError ... AccessDeniedError = "access-denied-error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error interface { error // Status returns the error code ErrorCode() ErrorCode // Generate log msg GenerateLogMsg() string // Generate client error msg GenerateClientErrorMsg() string }
Error extends error with additional context
func CreateError ¶
CreateError returns custom error
func WithMessage ¶
WithMessage returns a new Error
Click to show internal directories.
Click to hide internal directories.