errors

package
v0.0.0-...-2caf503 Latest Latest
Warning

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

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

Documentation

Overview

Package errors defines errors that can occur in command/input validation and execution and ways to handle those.

Index

Constants

This section is empty.

Variables

View Source
var APIError = &microerror.Error{
	Kind: "APIError",
}

APIError is happening when an error occurs in the API

View Source
var AccessForbiddenError = &microerror.Error{
	Kind: "AccessForbiddenError",
}

AccessForbiddenError means the client has been denied access to the API endpoint with a HTTP 403 error

View Source
var BadRequestError = &microerror.Error{
	Kind: "BadRequestError",
}

BadRequestError should be used when the server returns status 400 on cluster creation.

View Source
var CannotScaleBelowMinimumWorkersError = &microerror.Error{
	Kind: "CannotScaleBelowMinimumWorkersError",
}

CannotScaleBelowMinimumWorkersError means the user tries to scale to less nodes than allowed

View Source
var CannotScaleClusterError = &microerror.Error{
	Kind: "CannotScaleClusterError",
}

CannotScaleClusterError means the user tries to scale a cluster that does not support scaling, e. g. because it is a v5 cluster (node pools).

View Source
var ClusterDoesNotSupportNodePoolsError = &microerror.Error{
	Kind: "ClusterDoesNotSupportNodePoolsError",
}

ClusterDoesNotSupportNodePoolsError is raised when the user tries to do something with node pools on a cluster that does not support node pools.

View Source
var ClusterNameOrIDMissingError = &microerror.Error{
	Kind: "ClusterNameOrIDMissingError",
}

ClusterNameOrIDMissingError means a required cluster ID has not been given as input

View Source
var ClusterNotFoundError = &microerror.Error{
	Kind: "ClusterNotFoundError",
}

ClusterNotFoundError means that a given cluster does not exist

View Source
var ClusterOwnerMissingError = &microerror.Error{
	Kind: "ClusterOwnerMissingError",
}

ClusterOwnerMissingError means that the user has not specified an owner organization for a new cluster

View Source
var CommandAbortedError = &microerror.Error{
	Kind: "CommandAbortedError",
}

CommandAbortedError means that the user has aborted a command or input

View Source
var ConflictingFlagsError = &microerror.Error{
	Desc: "Some of the command line flags used cannot be combined.",
	Kind: "ConflictingFlagsError",
}

ConflictingFlagsError means that the user combined command line options that are incompatible

View Source
var ConflictingWorkerFlagsUsedError = &microerror.Error{
	Kind: "ConflictingWorkerFlagsUsedError",
}

ConflictingWorkerFlagsUsedError is raised when the deprecated --num-workers flag is used together with the new node count flags --workers-min and --workers-max.

View Source
var CouldNotCreateClientError = &microerror.Error{
	Kind: "CouldNotCreateClientError",
}

CouldNotCreateClientError means that a client could not be created

View Source
var CouldNotCreateClusterError = &microerror.Error{
	Kind: "CouldNotCreateClusterError",
}

CouldNotCreateClusterError should be used if the API call to create a cluster has been responded with status >= 400 and none of the other more specific errors apply.

View Source
var CouldNotCreateJSONRequestBodyError = &microerror.Error{
	Kind: "CouldNotCreateJSONRequestBodyError",
}

CouldNotCreateJSONRequestBodyError occurs when we could not create a JSON request body based on the input we have, so something in out input attributes is wrong.

View Source
var CouldNotDeleteClusterError = &microerror.Error{
	Kind: "CouldNotDeleteClusterError",
}

CouldNotDeleteClusterError should be used if the API call to delete a cluster has been responded with status >= 400

View Source
var CouldNotDeleteEndpointError = &microerror.Error{
	Kind: "CouldNotDeleteEndpointError",
}

CouldNotDeleteEndpointError should be used when the "API endpoint" could not be deleted

View Source
var CouldNotScaleClusterError = &microerror.Error{
	Kind: "CouldNotScaleClusterError",
}

CouldNotScaleClusterError should be used if the API call to scale a cluster has been responded with status >= 400

View Source
var CouldNotUpgradeClusterError = &microerror.Error{
	Kind: "CouldNotUpgradeClusterError",
	Desc: "could not upgrade cluster",
}

CouldNotUpgradeClusterError is thrown when a cluster upgrade failed.

View Source
var CouldNotWriteFileError = &microerror.Error{
	Kind: "CouldNotWriteFileError",
}

CouldNotWriteFileError is used when an attempt to write some file fails

View Source
var CredentialNotFoundError = &microerror.Error{
	Kind: "CredentialNotFoundError",
}

CredentialNotFoundError means that the specified credential could not be found

View Source
var CredentialsAlreadySetError = &microerror.Error{
	Kind: "CredentialsAlreadySetError",
}

CredentialsAlreadySetError means the user tried setting credential to an org that has credentials already.

View Source
var DesiredEqualsCurrentStateError = &microerror.Error{
	Kind: "DesiredEqualsCurrentStateError",
}

DesiredEqualsCurrentStateError means that the user described a desired state which is equal to the current state.

View Source
var DurationExceededError = &microerror.Error{
	Kind: "DurationExceededError",
}

DurationExceededError is thrown when a duration value is larger than can be represented internally

View Source
var EmptyPasswordError = &microerror.Error{
	Kind: "EmptyPasswordError",
}

EmptyPasswordError means the password supplied by the user was empty

View Source
var EndpointMissingError = &microerror.Error{
	Kind: "EndpointMissingError",
}

EndpointMissingError means the user has not given an endpoint where expected

View Source
var EndpointNotFoundError = &microerror.Error{
	Kind: "EndpointNotFoundError",
}

EndpointNotFoundError should be used when the user tries to delete an "API endpoint" that does not exist

View Source
var IncompatibleSettingsError = &microerror.Error{
	Kind: "IncompatibleSettingsError",
}

IncompatibleSettingsError means user has mixed incompatible settings related to different providers.

View Source
var InternalServerError = &microerror.Error{
	Kind: "InternalServerError",
}

InternalServerError should only be used in case of server communication being responded to with a response status >= 500. See also: unknownError

View Source
var InvalidCNPrefixError = &microerror.Error{
	Kind: "InvalidCNPrefixError",
}

InvalidCNPrefixError means the user has used bad characters in the CN prefix argument

View Source
var InvalidCredentialsError = &microerror.Error{
	Kind: "InvalidCredentialsError",
}

InvalidCredentialsError means the user's credentials could not be verified by the API

View Source
var InvalidDurationError = &microerror.Error{
	Kind: "InvalidDurationError",
}

InvalidDurationError means that a user-provided duration string could not be parsed

View Source
var InvalidNodePoolIDArgumentError = &microerror.Error{
	Kind: "InvalidNodePoolIDArgumentError",
}

InvalidNodePoolIDArgumentError should be raised when the user gives a "clusterID/nodepoolID" argument that is syntactically incorrect.

View Source
var InvalidReleaseError = &microerror.Error{
	Kind: "InvalidReleaseError",
}

InvalidReleaseError means that the customer entered an invalid release.

View Source
var KubectlMissingError = &microerror.Error{
	Kind: "KubectlMissingError",
}

KubectlMissingError means that the 'kubectl' executable is not available

View Source
var NoEmailArgumentGivenError = &microerror.Error{
	Kind: "NoEmailArgumentGivenError",
}

NoEmailArgumentGivenError means the email argument was required but not given/empty

View Source
var NoOpError = &microerror.Error{
	Kind: "NoOpError",
	Desc: "Nothing to be done",
}

NoOpError is raised when the user calls a command without any meaningful parameters, resulting in no change/nothing done.

View Source
var NoResponseError = &microerror.Error{
	Kind: "NoResponseError",
}

NoResponseError means the server side has not returned a response.

View Source
var NoUpgradeAvailableError = &microerror.Error{
	Kind: "NoUpgradeAvailableError",
	Desc: "no upgrade available for the current version",
}

NoUpgradeAvailableError means that the user wanted to start an upgrade, but there is no newer version available for the given cluster

View Source
var NodePoolIDMalformedError = &microerror.Error{
	Kind: "NodePoolIDMalformedError",
}

NodePoolIDMalformedError means a cluster/nodepool ID tuple has been formatted the wrong way.

View Source
var NodePoolIDMissingError = &microerror.Error{
	Kind: "NodePoolIDMissingError",
}

NodePoolIDMissingError means a required node pool ID has not been given as input

View Source
var NodePoolNotFoundError = &microerror.Error{
	Kind: "NodePoolNotFoundError",
}

NodePoolNotFoundError means that a node pool the user wants to interact with does not exist.

View Source
var NotAuthorizedError = &microerror.Error{
	Kind: "NotAuthorizedError",
}

NotAuthorizedError means that an API action could not be performed due to an authorization problem (usually a HTTP 401 error)

View Source
var NotEnoughWorkerNodesError = &microerror.Error{
	Kind: "NotEnoughWorkerNodesError",
}

NotEnoughWorkerNodesError means that the user has specified a too low number of worker nodes for a cluster

View Source
var NotLoggedInError = &microerror.Error{
	Kind: "NotLoggedInError",
}

NotLoggedInError means that the user is currently not authenticated

View Source
var NotPercentage = &microerror.Error{
	Kind: "NotPercentage",
	Desc: "Value should be in the range between 0 and 100.",
}

NotPercentage should be used when the user tries to set a percentage value outside 0-100

View Source
var OrganizationNotFoundError = &microerror.Error{
	Kind: "OrganizationNotFoundError",
}

OrganizationNotFoundError means that the specified organization could not be found

View Source
var OrganizationNotSpecifiedError = &microerror.Error{
	Kind: "OrganizationNotSpecifiedError",
}

OrganizationNotSpecifiedError means that the user has not specified an organization to work with

View Source
var OutputFormatInvalidError = &microerror.Error{
	Kind: "OutputFormatInvalidError",
}

OutputFormatInvalidError is raised when the user specifies an unsupported output format.

View Source
var PasswordArgumentNotApplicableError = &microerror.Error{
	Kind: "PasswordArgumentNotApplicableError",
}

PasswordArgumentNotApplicableError means the user used --password argument but it wasn't permitted for that command

View Source
var ProviderNotSupportedError = &microerror.Error{
	Kind: "ProviderNotSupportedError",
}

ProviderNotSupportedError means that the intended action is not possible with the installation's provider.

View Source
var ReleaseNotFoundError = &microerror.Error{
	Kind: "ReleaseNotFoundError",
}

ReleaseNotFoundError means that a given release does not exist.

View Source
var ReleaseVersionMissingError = &microerror.Error{
	Kind: "ReleaseVersionMissingError",
}

ReleaseVersionMissingError means the required release version argument is missing

View Source
var RequiredFlagMissingError = &microerror.Error{
	Kind: "RequiredFlagMissingError",
}

RequiredFlagMissingError means that a required flag has not been set by the user.

View Source
var SSOError = &microerror.Error{
	Kind: "SSOError",
}

SSOError means something went wrong during the SSO process

View Source
var TokenArgumentNotApplicableError = &microerror.Error{
	Kind: "TokenArgumentNotApplicableError",
}

TokenArgumentNotApplicableError means the user used --auth-token argument but it wasn't permitted for that command

View Source
var UnknownError = &microerror.Error{
	Kind: "UnknownError",
}

UnknownError should be thrown if we have no idea what went wrong.

View Source
var UnspecifiedAPIError = &microerror.Error{
	Kind: "UnspecifiedAPIError",
}

UnspecifiedAPIError means an API error has occurred which we can't or don't need to categorize any further.

View Source
var UpdateCheckFailed = &microerror.Error{
	Kind: "UpdateCheckFailed",
}

UpdateCheckFailed means that checking for a newer gsctl version failed.

View Source
var UserAccountInactiveError = &microerror.Error{
	Kind: "UserAccountInactiveError",
}

UserAccountInactiveError means that the user account is marked as inative by the API

View Source
var WorkersMinMaxInvalidError = &microerror.Error{
	Kind: "WorkersMinMaxInvalidError",
	Desc: "min must not be higher than max",
}

WorkersMinMaxInvalidError is raised when the value of the node count flag --workers-min is higher than the value of the node count flag --workers-max.

View Source
var YAMLFileNotReadableError = &microerror.Error{
	Kind: "YAMLFileNotReadableError",
}

YAMLFileNotReadableError means a YAML file was not readable

View Source
var YAMLNotParseableError = &microerror.Error{
	Kind: "YAMLNotParseableError",
}

YAMLNotParseableError means a YAML file was not readable

Functions

func HandleCommonErrors

func HandleCommonErrors(err error)

HandleCommonErrors is a common function to handle certain errors happening in more than one command. If the error given is handled by the function, it prints according text for the end user and exits the process. If the error is not recognized, we simply return.

func IsAPIError

func IsAPIError(err error) bool

IsAPIError asserts APIError.

func IsAccessForbiddenError

func IsAccessForbiddenError(err error) bool

IsAccessForbiddenError asserts AccessForbiddenError

func IsBadRequestError

func IsBadRequestError(err error) bool

IsBadRequestError asserts BadRequestError

func IsCannotScaleBelowMinimumWorkersError

func IsCannotScaleBelowMinimumWorkersError(err error) bool

IsCannotScaleBelowMinimumWorkersError asserts CannotScaleBelowMinimumWorkersError.

func IsCannotScaleCluster

func IsCannotScaleCluster(err error) bool

IsCannotScaleCluster asserts CannotScaleClusterError.

func IsClusterDoesNotSupportNodePools

func IsClusterDoesNotSupportNodePools(err error) bool

IsClusterDoesNotSupportNodePools asserts ClusterDoesNotSupportNodePoolsError.

func IsClusterNameOrIDMissingError

func IsClusterNameOrIDMissingError(err error) bool

IsClusterNameOrIDMissingError asserts ClusterNameOrIDMissingError.

func IsClusterNotFoundError

func IsClusterNotFoundError(err error) bool

IsClusterNotFoundError asserts ClusterNotFoundError.

func IsClusterOwnerMissingError

func IsClusterOwnerMissingError(err error) bool

IsClusterOwnerMissingError asserts ClusterOwnerMissingError.

func IsCommandAbortedError

func IsCommandAbortedError(err error) bool

IsCommandAbortedError asserts CommandAbortedError

func IsConflictingFlagsError

func IsConflictingFlagsError(err error) bool

IsConflictingFlagsError asserts ConflictingFlagsError.

func IsConflictingWorkerFlagsUsed

func IsConflictingWorkerFlagsUsed(err error) bool

IsConflictingWorkerFlagsUsed asserts ConflictingWorkerFlagsUsedError.

func IsCouldNotCreateClientError

func IsCouldNotCreateClientError(err error) bool

IsCouldNotCreateClientError asserts CouldNotCreateClientError.

func IsCouldNotCreateClusterError

func IsCouldNotCreateClusterError(err error) bool

IsCouldNotCreateClusterError asserts CouldNotCreateClusterError.

func IsCouldNotCreateJSONRequestBodyError

func IsCouldNotCreateJSONRequestBodyError(err error) bool

IsCouldNotCreateJSONRequestBodyError asserts CouldNotCreateJSONRequestBodyError.

func IsCouldNotDeleteClusterError

func IsCouldNotDeleteClusterError(err error) bool

IsCouldNotDeleteClusterError asserts CouldNotDeleteClusterError.

func IsCouldNotDeleteEndpointError

func IsCouldNotDeleteEndpointError(err error) bool

IsCouldNotDeleteEndpointError asserts CouldNotDeleteEndpointError.

func IsCouldNotScaleClusterError

func IsCouldNotScaleClusterError(err error) bool

IsCouldNotScaleClusterError asserts CouldNotScaleClusterError.

func IsCouldNotUpgradeClusterError

func IsCouldNotUpgradeClusterError(err error) bool

IsCouldNotUpgradeClusterError asserts CouldNotUpgradeClusterError

func IsCouldNotWriteFileError

func IsCouldNotWriteFileError(err error) bool

IsCouldNotWriteFileError asserts CouldNotWriteFileError

func IsCredentialNotFoundError

func IsCredentialNotFoundError(err error) bool

IsCredentialNotFoundError asserts CredentialNotFoundError

func IsCredentialsAlreadySetError

func IsCredentialsAlreadySetError(err error) bool

IsCredentialsAlreadySetError asserts CredentialsAlreadySetError.

func IsDesiredEqualsCurrentStateError

func IsDesiredEqualsCurrentStateError(err error) bool

IsDesiredEqualsCurrentStateError asserts DesiredEqualsCurrentStateError.

func IsDurationExceededError

func IsDurationExceededError(err error) bool

IsDurationExceededError asserts DurationExceededError

func IsEmptyPasswordError

func IsEmptyPasswordError(err error) bool

IsEmptyPasswordError asserts EmptyPasswordError.

func IsEndpointMissingError

func IsEndpointMissingError(err error) bool

IsEndpointMissingError asserts EndpointMissingError.

func IsEndpointNotFoundError

func IsEndpointNotFoundError(err error) bool

IsEndpointNotFoundError asserts EndpointNotFoundError.

func IsIncompatibleSettings

func IsIncompatibleSettings(err error) bool

IsIncompatibleSettings asserts IncompatibleSettingsError.

func IsInternalServerError

func IsInternalServerError(err error) bool

IsInternalServerError asserts InternalServerError.

func IsInvalidCNPrefixError

func IsInvalidCNPrefixError(err error) bool

IsInvalidCNPrefixError asserts InvalidCNPrefixError

func IsInvalidCredentialsError

func IsInvalidCredentialsError(err error) bool

IsInvalidCredentialsError asserts InvalidCredentialsError

func IsInvalidDurationError

func IsInvalidDurationError(err error) bool

IsInvalidDurationError asserts InvalidDurationError

func IsInvalidNodePoolIDArgument

func IsInvalidNodePoolIDArgument(err error) bool

IsInvalidNodePoolIDArgument asserts InvalidNodePoolIDArgumentError.

func IsInvalidReleaseError

func IsInvalidReleaseError(err error) bool

IsInvalidReleaseError asserts InvalidReleaseError.

func IsKubectlMissingError

func IsKubectlMissingError(err error) bool

IsKubectlMissingError asserts KubectlMissingError

func IsNoEmailArgumentGivenError

func IsNoEmailArgumentGivenError(err error) bool

IsNoEmailArgumentGivenError asserts NoEmailArgumentGivenError

func IsNoOpError

func IsNoOpError(err error) bool

IsNoOpError asserts NoOpError.

func IsNoResponseError

func IsNoResponseError(err error) bool

IsNoResponseError asserts NoResponseError.

func IsNoUpgradeAvailableError

func IsNoUpgradeAvailableError(err error) bool

IsNoUpgradeAvailableError asserts NoUpgradeAvailableError

func IsNodePoolIDMalformedError

func IsNodePoolIDMalformedError(err error) bool

IsNodePoolIDMalformedError asserts IsNodePoolIDMalformedError.

func IsNodePoolIDMissingError

func IsNodePoolIDMissingError(err error) bool

IsNodePoolIDMissingError asserts NodePoolIDMissingError.

func IsNodePoolNotFound

func IsNodePoolNotFound(err error) bool

IsNodePoolNotFound asserts NodePoolNotFoundError.

func IsNotAuthorizedError

func IsNotAuthorizedError(err error) bool

IsNotAuthorizedError asserts NotAuthorizedError.

func IsNotEnoughWorkerNodesError

func IsNotEnoughWorkerNodesError(err error) bool

IsNotEnoughWorkerNodesError asserts NotEnoughWorkerNodesError.

func IsNotLoggedInError

func IsNotLoggedInError(err error) bool

IsNotLoggedInError asserts NotLoggedInError.

func IsOrganizationNotFoundError

func IsOrganizationNotFoundError(err error) bool

IsOrganizationNotFoundError asserts OrganizationNotFoundError

func IsOrganizationNotSpecifiedError

func IsOrganizationNotSpecifiedError(err error) bool

IsOrganizationNotSpecifiedError asserts OrganizationNotSpecifiedError

func IsOutputFormatInvalid

func IsOutputFormatInvalid(err error) bool

IsOutputFormatInvalid asserts OutputFormatInvalidError.

func IsPasswordArgumentNotApplicableError

func IsPasswordArgumentNotApplicableError(err error) bool

IsPasswordArgumentNotApplicableError asserts PasswordArgumentNotApplicableError.

func IsProviderNotSupportedError

func IsProviderNotSupportedError(err error) bool

IsProviderNotSupportedError asserts ProviderNotSupportedError.

func IsReleaseNotFoundError

func IsReleaseNotFoundError(err error) bool

IsReleaseNotFoundError asserts ReleaseNotFoundError.

func IsReleaseVersionMissingError

func IsReleaseVersionMissingError(err error) bool

IsReleaseVersionMissingError asserts ReleaseVersionMissingError.

func IsRequiredFlagMissingError

func IsRequiredFlagMissingError(err error) bool

IsRequiredFlagMissingError asserts RequiredFlagMissingError.

func IsSSOError

func IsSSOError(err error) bool

IsSSOError asserts SSOError

func IsTokenArgumentNotApplicableError

func IsTokenArgumentNotApplicableError(err error) bool

IsTokenArgumentNotApplicableError asserts TokenArgumentNotApplicableError.

func IsUnknownError

func IsUnknownError(err error) bool

IsUnknownError asserts UnknownError.

func IsUnspecifiedAPIError

func IsUnspecifiedAPIError(err error) bool

IsUnspecifiedAPIError asserts UnspecifiedAPIError

func IsUpdateCheckFailed

func IsUpdateCheckFailed(err error) bool

IsUpdateCheckFailed asserts UpdateCheckFailed.

func IsUserAccountInactiveError

func IsUserAccountInactiveError(err error) bool

IsUserAccountInactiveError asserts UserAccountInactiveError.

func IsWorkersMinMaxInvalid

func IsWorkersMinMaxInvalid(err error) bool

IsWorkersMinMaxInvalid asserts WorkersMinMaxInvalidError.

func IsYAMLFileNotReadable

func IsYAMLFileNotReadable(err error) bool

IsYAMLFileNotReadable asserts YAMLFileNotReadableError.

func IsYAMLNotParseable

func IsYAMLNotParseable(err error) bool

IsYAMLNotParseable asserts YAMLNotParseableError.

Types

This section is empty.

Jump to

Keyboard shortcuts

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