errors

package
v0.0.0-...-9c90d3e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidToken is returned when the api request token is invalid.
	ErrInvalidToken = New("Invalid or missing token")

	// ErrUnauthorized is returned when the user is not authorized.
	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")
)
View Source
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")
)
View Source
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")
)
View Source
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")
)
View Source
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")
)
View Source
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")
)
View Source
var ErrDeadlock = New("mysql transaction deadlock")

ErrDeadlock is returned when there is a transaction deadlock.

View Source
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.

View Source
var ErrLockWaitTimeout = New("mysql lock wait timeout")

ErrLockWaitTimeout is returned where there is a mysql lock wait timeout.

View Source
var ErrNamespaceNotFound = New("Namespace not found")

ErrNamespaceNotFound is returned when a vault namespace is not found.

View Source
var ErrRowsNotFound = sql.ErrNoRows

ErrRowsNotFound is returned by Scan when QueryRow doesn't return a row.

View Source
var ErrSecretNotFound = New("Secrets not found")

ErrSecretNotFound is returned when a vault secret is not found in path.

Functions

func AzureError

func AzureError(err error) error

AzureError is an error type that represents an error returned from Azure.

func EntityNotFoundErr

func EntityNotFoundErr(entity, container string) error

EntityNotFoundErr is a error function corresponding to missing entities.

func InvalidInReqErr

func InvalidInReqErr(field string) error

InvalidInReqErr is a error function corresponding to invalid requests.

func InvalidQueryErr

func InvalidQueryErr(key string) error

InvalidQueryErr is a error function corresponding to invalid queries.

func MissingInQueryErr

func MissingInQueryErr(key string) error

MissingInQueryErr is a error function corresponding to missing query params.

func MissingInReqErr

func MissingInReqErr(field string) error

MissingInReqErr is a error function corresponding to missing request entities.

func New

func New(text string) error

New returns a new error message.

func SQLError

func SQLError(err error) error

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.

func (*Error) Error

func (e *Error) Error() string

type ValidationError

type ValidationError struct {
	Field  string `json:"field"`
	Reason string `json:"reason"`
}

ValidationError represents the request payload validation error.

Jump to

Keyboard shortcuts

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