Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessage ¶
func HasErrorCode ¶
HasErrorCode verify the type of error and the code.
Types ¶
type Error ¶
type Error struct { Code ErrorCode Message string Wrap error // contains filtered or unexported fields }
func NewErrorWithMessage ¶
func (*Error) SetHTTPCode ¶
SetHTTPCode sets the HTTP code manually.
type ErrorCode ¶
type ErrorCode string
const ( // ErrorCodeConfigInvalid is that an error occurs when it parse the file. ErrorCodeConfigInvalid ErrorCode = "config_parse_error" // ErrorCodeConfigUndefinedEnv is that the environment is not defined in the configuration file. ErrorCodeConfigUndefinedEnv ErrorCode = "config_undefined_env" // ErrorCodeDeploymentConflict is the deployment number is conflicted. ErrorCodeDeploymentConflict ErrorCode = "deployment_conflict" // ErrorCodeDeploymentInvalid is the payload is invalid. ErrorCodeDeploymentInvalid ErrorCode = "deployment_invalid" // ErrorCodeDeploymentLocked is when the environment is locked. ErrorCodeDeploymentLocked ErrorCode = "deployment_locked" // ErrorCodeDeploymentFrozen is when the time in in the freeze window. ErrorCodeDeploymentFrozen ErrorCode = "deployment_frozen" // ErrorCodeDeploymentUnapproved is when the deployment is not approved. ErrorCodeDeploymentNotApproved ErrorCode = "deployment_not_approved" // ErrorCodeDeploymentSerialization is the serialization error. ErrorCodeDeploymentSerialization ErrorCode = "deployment_serialization" // ErrorCodeDeploymentStatusNotWaiting is the status must be 'waiting' to create a remote deployment. ErrorCodeDeploymentStatusInvalid ErrorCode = "deployment_status_invalid" // ErrorCodeEntityNotFound is the entity is not found. // Entity is a resource of store or scm. ErrorCodeEntityNotFound ErrorCode = "entity_not_found" // ErrorCodeEntityUnprocessable is the entity is unprocessable. ErrorCodeEntityUnprocessable ErrorCode = "entity_unprocessable" // ErrorCodeInternalError is the internal error couldn't be handled. ErrorCodeInternalError ErrorCode = "internal_error" // ErrorCodeLockAlreadyExist is that the environment is already locked. ErrorCodeLockAlreadyExist ErrorCode = "lock_already_exist" // ErrorCodeLicenseDecode is the error when the license is decoded. ErrorCodeLicenseDecode ErrorCode = "license_decode" // ErrorCodeLicenseRequired is that the license is required. ErrorCodeLicenseRequired ErrorCode = "license_required" // ErrorCodeParameterInvalid is a parameter of a request is invalid. ErrorCodeParameterInvalid ErrorCode = "parameter_invalid" // ErrorPermissionRequired is the permission is required to access. ErrorPermissionRequired ErrorCode = "permission_required" // ErrorRepoUniqueName is the repository name must be unique. ErrorRepoUniqueName ErrorCode = "repo_unique_name" )
type ErrorStatus ¶
type ErrorStatus int
Click to show internal directories.
Click to hide internal directories.