errors

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrDataUnmarshal will happen when translate the string to the struct, or cannot translate structure from one type to the other.
	ErrDataUnmarshal = newKappError(commonErrCode, http.StatusBadRequest, 1, "Data unmarshal error.")

	// ErrServiceInstall has some problem for CloudNativeService deploying failed. May because of cluster disconnection, or cluster limitation problems.
	ErrServiceInstall = newKappError(serviceErrCode, http.StatusBadRequest, 2, "Service install error.")
	// ErrServiceParam cannot analysis or get the param from request
	ErrServiceParam = newKappError(serviceErrCode, http.StatusBadRequest, 3, "Parameter is invalid.")
	// ErrServiceDelete cannot delete the service in cluster
	ErrServiceDelete = newKappError(serviceErrCode, http.StatusBadRequest, 4, "ServiceBinding delete error.")

	// ErrServiceInstanceCreate cannot deploy the user's instance into cluster
	ErrServiceInstanceCreate = newKappError(serviceInstanceErrCode, http.StatusInternalServerError, 1, "Service Instance create error.")
)

Functions

This section is empty.

Types

type ErrorResp

type ErrorResp struct {
	ErrorCode string `json:"errorCode"`
	Message   string `json:"errorMsg"`
	Reason    string `json:"reason,omitempty"`
}

ErrorResp error response

type KappError

type KappError interface {
	error
	GetHTTPCode() int
	GetErrorCode() string
	GetResp() ErrorResp
	WrapErrorReasonWith(format string, args ...interface{}) KappError
	TypeEqual(err KappError) bool
}

KappError the error that will be used in the manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL