Documentation ¶
Index ¶
- Variables
- func AzureError(err error) error
- func EntityNotFoundErr(entity, container string) error
- func InvalidInReqErr(field string) error
- func InvalidQueryErr(key string) error
- func MissingInQueryErr(key string) error
- func MissingInReqErr(field string) error
- func New(text string) error
- func SQLError(err error) error
- func ValidationErr(err error) interface{}
- type ErrSkipRetry
- type Error
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidToken is returned when the api request token is invalid. ErrInvalidToken = New("Invalid or missing token") ErrUnauthorized = New("Unauthorized") // ErrForbidden is returned when user access is forbidden. ErrForbidden = New("Forbidden") // ErrNotFound is returned when a resource is not found. ErrNotFound = New("Not Found") // ErrInvalidDriver is returned when SCM driver is not defined ErrInvalidDriver = New("Invalid Git SCM driver") // ErrInvalidCursor is returned when the cursor is invalid in query params ErrInvalidCursor = New("Invalid cursor") // ErrPerPageVal is returned when the per_page is invalid in query params ErrPerPageVal = New("Invalid per_page value") // ErrMissingOrgID is returned when orgID not found in the request context. ErrMissingOrgID = New("Missing orgID in request context") // ErrMissingSecreteKey is returned when orgID not found in the request context. ErrMissingSecreteKey = New("Missing lambdatestSecretKey in request context") // ErrInvalidLoggerInstance is returned when logger instance is not supported. ErrInvalidLoggerInstance = New("Invalid logger instance") // ErrInvalidDate is returned when date difference exceeds 6 months ErrInvalidDate = New("endDate and startDate time difference limit exceeded") )
var ( // ErrTimeoutExceeded is returned when graceful timeout period exceeds. ErrTimeoutExceeded = New("Timeout exceeded") // ErrInvalidEnvironemt is returned when the env is incorrect. ErrInvalidEnvironemt = New("Invalid Environment") // ErrInvalidQueuePayload is returned when type assertion fails in queue producer. ErrInvalidQueuePayload = New("Invalid Queue Payload") // GenericUserFacingBEErrRemark is generic error message for user facing errors. GenericUserFacingBEErrRemark = New("Unexpected error") // GenericTaskTimeoutErrorRemark is generic error message for task timeout errors. GenericTaskTimeoutErrorRemark = New("Timed Out") // GenericTaskAbortedErrorRemark is generic error message for task abort errors. GenericTaskAbortedErrorRemark = New("Aborted") // GenericJobTimeoutErrRemark is a generic remark after job timeout GenericJobTimeoutErrRemark = New("Job timeout") // GenericErrorMessage is generic error message returned to UI GenericErrorMessage = New("Unexpected error. Please try again later.") // ErrUnknownContainer is returned when the azure container name is invalid. ErrUnknownContainer = New("Unknown azure container") // ErrAzureConfig is returned when missing values in azure blob config ErrAzureConfig = New("missing values in azure blob config") // ErrConfigAlreadyExists is returned when config id exists ErrConfigAlreadyExists = New("Config already exists") // ErrConfigNotFound is returned when no config found ErrConfigNotFound = New("config not found") // ErrPostMergeThresholdNotMet is returned when postmerge threshold is not met ErrPostMergeThresholdNotMet = New("postmerge threshold is not met") // ErrUnSupportedPostMergeStrategy is returned when user provide unsupported postmerge strategy ErrUnSupportedPostMergeStrategy = New("unsupported postmerge strategy") // ErrUnsupportedGitProvider is returned when try to integrate unsupported provider repo ErrUnsupportedGitProvider = New("unsupported gitprovider") // ErrTypeAssertionFailed is returned when type assertion fails for a var ErrTypeAssertionFailed = New("type assertion failed") // ErrMissingBuildData indicates build data missing while setting claim in JWT token. ErrMissingBuildData = New("Missing build data while creating token") // ErrMissingBuildIDClaim indicates build_id claim missing in JWT token. ErrMissingBuildIDClaim = New("Missing build_id in token") // ErrMissingRepoIDClaim indicates repo_id claim missing in JWT token. ErrMissingRepoIDClaim = New("Missing repo_id in token") // ErrMissingOrgIDClaim indicates org_id claim missing in JWT token. ErrMissingOrgIDClaim = New("Missing org_id in token") // ErrParsingSecret indicates that the secret cannot be parsed ErrParsingSecret = New("Unparseable secret") )
var ( // ErrSignatureInvalid is returned when the webhook // signature is invalid or cannot be calculated. ErrSignatureInvalid = New("Invalid webhook signature") // ErrUnknownEvent is returned when the webhook event // is not recognized by the system. ErrUnknownEvent = New("Unknown webhook event") // ErrQuery is returned when database query fails ErrQuery = New("SQL query failed") // ErrEmptyCommit is returned when there is empty commit event ErrEmptyCommit = New("Empty commit") // ErrPingEvent is returned when database query fails ErrPingEvent = New("webhook ping event") // ErrNotSupported is returned when database query fails ErrNotSupported = New("Event not supported") // ErrMarshalJSON is returned when json marshal failed ErrMarshalJSON = New("JSON marshal failed") // ErrUnMarshalJSON is returned when json unmarshal failed ErrUnMarshalJSON = New("JSON unmarshal failed") // ErrAzureUpload is returned when azure blob upload fails ErrAzureUpload = New("failed to upload blob to azure storage") // ErrRedisKeyNotFound is returned when redis key is not found ErrRedisKeyNotFound = New("Redis key not found") )
var ( // ErrInvalidPrivKey indicates that the given private key is invalid ErrInvalidPrivKey = New("Private key invalid") // ErrInvalidPubKey indicates the the given public key is invalid ErrInvalidPubKey = New("Public key invalid") // ErrFailedTokenCreation indicates JWT Token failed to create, reason unknown ErrFailedTokenCreation = New("Failed to create JWT Token") // ErrInvalidAuthHeader indicates invalid Authorization header ErrInvalidAuthHeader = New("Authorization header invalid") // ErrMissingToken indicates the jwt token is not present ErrMissingToken = New("Missing Access Token") // ErrInvalidSigningAlgorithm indicates signing algorithm is invalid, needs to be HS256, HS384, HS512, RS256, RS384 or RS512 ErrInvalidSigningAlgorithm = New("Invalid signing algorithm") // ErrInvalidJWTToken indicates JWT token is invalid. ErrInvalidJWTToken = New("Invalid token") // ErrExpiredToken indicates JWT token has expired. ErrExpiredToken = New("Token has expired") // ErrMissingUserData indicates user data missing while setting claim in JWT token. ErrMissingUserData = New("Missing user data while creating token") // ErrMissingUserID indicates user_id claim missing in JWT token. ErrMissingUserID = New("Missing user_id in Token") // ErrMissingJTI indicates jti claim missing in JWT token. ErrMissingJTI = New("Missing jti in Token") // ErrMissingGitProvider indicates git_provider claim missing in JWT token. ErrMissingGitProvider = New("Missing git_provider in Token") // ErrMissingUserName indicates username claim missing in JWT token. ErrMissingUserName = New("Missing username in Token") )
var ( // ErrPodDeleted is returned when the k8s pod gets deleted. ErrPodDeleted = New("Pod Deleted") // ErrContainerExited is returned when the contanier gets terminated after non zero exit code. ErrContainerExited = New("Pod exited with non zero exit code") // ErrOOMKilled is returned when container terminated with OOM Killed error. ErrOOMKilled = New("OOM Killed") // ErrInitContainerExited is returned when the init contanier gets terminated after non zero exit code. ErrInitContainerExited = New("Vault Init container with non zero exit code") // ErrPodStatus is returned when the pod has Error status. ErrPodStatus = New("Error pod status") // ErrInvalidSlug is returned when the slug (orgName/repoName) is invalid. ErrInvalidSlug = New("Invalid repo slug") )
var ( // ErrSynapseNotFound is returned when there is no available synpase ErrSynapseNotFound = New("No Synapse avaialbale for given resource constraint") // ErrSynapseMessageExceedAllotedTime is returned when message is in queue for too long ErrSynapseMessageExceedAllotedTime = New("Message exceed time duration") // ErrSynapseDuplicateConnection will be thrown when synapse try to connect to neuron and there is already one connection open ErrSynapseDuplicateConnection = New("Synapse already has an open connection") // ErrSynapseAuthFailed should be thrown when authentication failed ErrSynapseAuthFailed = New("Synapse authentication failed") // ErrSynapseMinRequirement will be thrown if synapse does not meet minimum requirement ErrSynapseMinRequirement = New("Synapse does not meet min requirement") )
var ErrDeadlock = New("mysql transaction deadlock")
ErrDeadlock is returned when there is a transaction deadlock.
var ErrDupeKey = New("resource already exits")
ErrDupeKey is returned when a unique index prevents a value from being inserted or updated. CanRetry returns false on this error.
var ErrLockWaitTimeout = New("mysql lock wait timeout")
ErrLockWaitTimeout is returned where there is a mysql lock wait timeout.
var ErrNamespaceNotFound = New("Namespace not found")
ErrNamespaceNotFound is returned when a vault namespace is not found.
var ErrRowsNotFound = sql.ErrNoRows
ErrRowsNotFound is returned by Scan when QueryRow doesn't return a row.
var ErrSecretNotFound = New("Secrets not found")
ErrSecretNotFound is returned when a vault secret is not found in path.
Functions ¶
func AzureError ¶
AzureError is an error type that represents an error returned from Azure.
func EntityNotFoundErr ¶
EntityNotFoundErr is a error function corresponding to missing entities.
func InvalidInReqErr ¶
InvalidInReqErr is a error function corresponding to invalid requests.
func InvalidQueryErr ¶
InvalidQueryErr is a error function corresponding to invalid queries.
func MissingInQueryErr ¶
MissingInQueryErr is a error function corresponding to missing query params.
func MissingInReqErr ¶
MissingInReqErr is a error function corresponding to missing request entities.
func SQLError ¶
SQLError returns an error in this package if possible. The error return value is an error in this package if the given error maps to one, else the given error is returned.
func ValidationErr ¶
func ValidationErr(err error) interface{}
ValidationErr is a error function corresponding to invalid request payloads.
Types ¶
type ErrSkipRetry ¶
type ErrSkipRetry struct {
Err error
}
ErrSkipRetry is returned when retry attempt needs to be skipped
func (*ErrSkipRetry) Error ¶
func (e *ErrSkipRetry) Error() string
Error gives a human-readable description of the error.
type Error ¶
type Error struct {
Message string `json:"message"`
}
Error represents a json-encoded API error.
type ValidationError ¶
ValidationError represents the request payload validation error.