Documentation ¶
Overview ¶
Package errors defines errors that can occur in command/input validation and execution and ways to handle those.
Index ¶
- Variables
- func HandleCommonErrors(err error)
- func IsAPIError(err error) bool
- func IsAccessForbiddenError(err error) bool
- func IsBadRequestError(err error) bool
- func IsCannotScaleBelowMinimumWorkersError(err error) bool
- func IsCannotScaleCluster(err error) bool
- func IsClusterDoesNotSupportNodePools(err error) bool
- func IsClusterNameOrIDMissingError(err error) bool
- func IsClusterNotFoundError(err error) bool
- func IsClusterOwnerMissingError(err error) bool
- func IsCommandAbortedError(err error) bool
- func IsConflictingFlagsError(err error) bool
- func IsConflictingWorkerFlagsUsed(err error) bool
- func IsCouldNotCreateClientError(err error) bool
- func IsCouldNotCreateClusterError(err error) bool
- func IsCouldNotCreateJSONRequestBodyError(err error) bool
- func IsCouldNotDeleteClusterError(err error) bool
- func IsCouldNotDeleteEndpointError(err error) bool
- func IsCouldNotScaleClusterError(err error) bool
- func IsCouldNotUpgradeClusterError(err error) bool
- func IsCouldNotWriteFileError(err error) bool
- func IsCredentialNotFoundError(err error) bool
- func IsCredentialsAlreadySetError(err error) bool
- func IsDesiredEqualsCurrentStateError(err error) bool
- func IsDurationExceededError(err error) bool
- func IsEmptyPasswordError(err error) bool
- func IsEndpointMissingError(err error) bool
- func IsEndpointNotFoundError(err error) bool
- func IsIncompatibleSettings(err error) bool
- func IsInternalServerError(err error) bool
- func IsInvalidCNPrefixError(err error) bool
- func IsInvalidCredentialsError(err error) bool
- func IsInvalidDurationError(err error) bool
- func IsInvalidNodePoolIDArgument(err error) bool
- func IsInvalidReleaseError(err error) bool
- func IsKubectlMissingError(err error) bool
- func IsNoEmailArgumentGivenError(err error) bool
- func IsNoOpError(err error) bool
- func IsNoResponseError(err error) bool
- func IsNoUpgradeAvailableError(err error) bool
- func IsNodePoolIDMalformedError(err error) bool
- func IsNodePoolIDMissingError(err error) bool
- func IsNodePoolNotFound(err error) bool
- func IsNotAuthorizedError(err error) bool
- func IsNotEnoughWorkerNodesError(err error) bool
- func IsNotLoggedInError(err error) bool
- func IsOrganizationNotFoundError(err error) bool
- func IsOrganizationNotSpecifiedError(err error) bool
- func IsOutputFormatInvalid(err error) bool
- func IsPasswordArgumentNotApplicableError(err error) bool
- func IsProviderNotSupportedError(err error) bool
- func IsReleaseNotFoundError(err error) bool
- func IsReleaseVersionMissingError(err error) bool
- func IsRequiredFlagMissingError(err error) bool
- func IsSSOError(err error) bool
- func IsTokenArgumentNotApplicableError(err error) bool
- func IsUnknownError(err error) bool
- func IsUnspecifiedAPIError(err error) bool
- func IsUpdateCheckFailed(err error) bool
- func IsUserAccountInactiveError(err error) bool
- func IsWorkersMinMaxInvalid(err error) bool
- func IsYAMLFileNotReadable(err error) bool
- func IsYAMLNotParseable(err error) bool
Constants ¶
This section is empty.
Variables ¶
var APIError = µerror.Error{
Kind: "APIError",
}
APIError is happening when an error occurs in the API
var AccessForbiddenError = µerror.Error{
Kind: "AccessForbiddenError",
}
AccessForbiddenError means the client has been denied access to the API endpoint with a HTTP 403 error
var BadRequestError = µerror.Error{
Kind: "BadRequestError",
}
BadRequestError should be used when the server returns status 400 on cluster creation.
var CannotScaleBelowMinimumWorkersError = µerror.Error{
Kind: "CannotScaleBelowMinimumWorkersError",
}
CannotScaleBelowMinimumWorkersError means the user tries to scale to less nodes than allowed
var CannotScaleClusterError = µerror.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).
var ClusterDoesNotSupportNodePoolsError = µerror.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.
var ClusterNameOrIDMissingError = µerror.Error{
Kind: "ClusterNameOrIDMissingError",
}
ClusterNameOrIDMissingError means a required cluster ID has not been given as input
var ClusterNotFoundError = µerror.Error{
Kind: "ClusterNotFoundError",
}
ClusterNotFoundError means that a given cluster does not exist
var ClusterOwnerMissingError = µerror.Error{
Kind: "ClusterOwnerMissingError",
}
ClusterOwnerMissingError means that the user has not specified an owner organization for a new cluster
var CommandAbortedError = µerror.Error{
Kind: "CommandAbortedError",
}
CommandAbortedError means that the user has aborted a command or input
var ConflictingFlagsError = µerror.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
var ConflictingWorkerFlagsUsedError = µerror.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.
var CouldNotCreateClientError = µerror.Error{
Kind: "CouldNotCreateClientError",
}
CouldNotCreateClientError means that a client could not be created
var CouldNotCreateClusterError = µerror.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.
var CouldNotCreateJSONRequestBodyError = µerror.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.
var CouldNotDeleteClusterError = µerror.Error{
Kind: "CouldNotDeleteClusterError",
}
CouldNotDeleteClusterError should be used if the API call to delete a cluster has been responded with status >= 400
var CouldNotDeleteEndpointError = µerror.Error{
Kind: "CouldNotDeleteEndpointError",
}
CouldNotDeleteEndpointError should be used when the "API endpoint" could not be deleted
var CouldNotScaleClusterError = µerror.Error{
Kind: "CouldNotScaleClusterError",
}
CouldNotScaleClusterError should be used if the API call to scale a cluster has been responded with status >= 400
var CouldNotUpgradeClusterError = µerror.Error{
Kind: "CouldNotUpgradeClusterError",
Desc: "could not upgrade cluster",
}
CouldNotUpgradeClusterError is thrown when a cluster upgrade failed.
var CouldNotWriteFileError = µerror.Error{
Kind: "CouldNotWriteFileError",
}
CouldNotWriteFileError is used when an attempt to write some file fails
var CredentialNotFoundError = µerror.Error{
Kind: "CredentialNotFoundError",
}
CredentialNotFoundError means that the specified credential could not be found
var CredentialsAlreadySetError = µerror.Error{
Kind: "CredentialsAlreadySetError",
}
CredentialsAlreadySetError means the user tried setting credential to an org that has credentials already.
var DesiredEqualsCurrentStateError = µerror.Error{
Kind: "DesiredEqualsCurrentStateError",
}
DesiredEqualsCurrentStateError means that the user described a desired state which is equal to the current state.
var DurationExceededError = µerror.Error{
Kind: "DurationExceededError",
}
DurationExceededError is thrown when a duration value is larger than can be represented internally
var EmptyPasswordError = µerror.Error{
Kind: "EmptyPasswordError",
}
EmptyPasswordError means the password supplied by the user was empty
var EndpointMissingError = µerror.Error{
Kind: "EndpointMissingError",
}
EndpointMissingError means the user has not given an endpoint where expected
var EndpointNotFoundError = µerror.Error{
Kind: "EndpointNotFoundError",
}
EndpointNotFoundError should be used when the user tries to delete an "API endpoint" that does not exist
var IncompatibleSettingsError = µerror.Error{
Kind: "IncompatibleSettingsError",
}
IncompatibleSettingsError means user has mixed incompatible settings related to different providers.
var InternalServerError = µerror.Error{
Kind: "InternalServerError",
}
InternalServerError should only be used in case of server communication being responded to with a response status >= 500. See also: unknownError
var InvalidCNPrefixError = µerror.Error{
Kind: "InvalidCNPrefixError",
}
InvalidCNPrefixError means the user has used bad characters in the CN prefix argument
var InvalidCredentialsError = µerror.Error{
Kind: "InvalidCredentialsError",
}
InvalidCredentialsError means the user's credentials could not be verified by the API
var InvalidDurationError = µerror.Error{
Kind: "InvalidDurationError",
}
InvalidDurationError means that a user-provided duration string could not be parsed
var InvalidNodePoolIDArgumentError = µerror.Error{
Kind: "InvalidNodePoolIDArgumentError",
}
InvalidNodePoolIDArgumentError should be raised when the user gives a "clusterID/nodepoolID" argument that is syntactically incorrect.
var InvalidReleaseError = µerror.Error{
Kind: "InvalidReleaseError",
}
InvalidReleaseError means that the customer entered an invalid release.
var KubectlMissingError = µerror.Error{
Kind: "KubectlMissingError",
}
KubectlMissingError means that the 'kubectl' executable is not available
var NoEmailArgumentGivenError = µerror.Error{
Kind: "NoEmailArgumentGivenError",
}
NoEmailArgumentGivenError means the email argument was required but not given/empty
var NoOpError = µerror.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.
var NoResponseError = µerror.Error{
Kind: "NoResponseError",
}
NoResponseError means the server side has not returned a response.
var NoUpgradeAvailableError = µerror.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
var NodePoolIDMalformedError = µerror.Error{
Kind: "NodePoolIDMalformedError",
}
NodePoolIDMalformedError means a cluster/nodepool ID tuple has been formatted the wrong way.
var NodePoolIDMissingError = µerror.Error{
Kind: "NodePoolIDMissingError",
}
NodePoolIDMissingError means a required node pool ID has not been given as input
var NodePoolNotFoundError = µerror.Error{
Kind: "NodePoolNotFoundError",
}
NodePoolNotFoundError means that a node pool the user wants to interact with does not exist.
var NotAuthorizedError = µerror.Error{
Kind: "NotAuthorizedError",
}
NotAuthorizedError means that an API action could not be performed due to an authorization problem (usually a HTTP 401 error)
var NotEnoughWorkerNodesError = µerror.Error{
Kind: "NotEnoughWorkerNodesError",
}
NotEnoughWorkerNodesError means that the user has specified a too low number of worker nodes for a cluster
var NotLoggedInError = µerror.Error{
Kind: "NotLoggedInError",
}
NotLoggedInError means that the user is currently not authenticated
var NotPercentage = µerror.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
var OrganizationNotFoundError = µerror.Error{
Kind: "OrganizationNotFoundError",
}
OrganizationNotFoundError means that the specified organization could not be found
var OrganizationNotSpecifiedError = µerror.Error{
Kind: "OrganizationNotSpecifiedError",
}
OrganizationNotSpecifiedError means that the user has not specified an organization to work with
var OutputFormatInvalidError = µerror.Error{
Kind: "OutputFormatInvalidError",
}
OutputFormatInvalidError is raised when the user specifies an unsupported output format.
var PasswordArgumentNotApplicableError = µerror.Error{
Kind: "PasswordArgumentNotApplicableError",
}
PasswordArgumentNotApplicableError means the user used --password argument but it wasn't permitted for that command
var ProviderNotSupportedError = µerror.Error{
Kind: "ProviderNotSupportedError",
}
ProviderNotSupportedError means that the intended action is not possible with the installation's provider.
var ReleaseNotFoundError = µerror.Error{
Kind: "ReleaseNotFoundError",
}
ReleaseNotFoundError means that a given release does not exist.
var ReleaseVersionMissingError = µerror.Error{
Kind: "ReleaseVersionMissingError",
}
ReleaseVersionMissingError means the required release version argument is missing
var RequiredFlagMissingError = µerror.Error{
Kind: "RequiredFlagMissingError",
}
RequiredFlagMissingError means that a required flag has not been set by the user.
var SSOError = µerror.Error{
Kind: "SSOError",
}
SSOError means something went wrong during the SSO process
var TokenArgumentNotApplicableError = µerror.Error{
Kind: "TokenArgumentNotApplicableError",
}
TokenArgumentNotApplicableError means the user used --auth-token argument but it wasn't permitted for that command
var UnknownError = µerror.Error{
Kind: "UnknownError",
}
UnknownError should be thrown if we have no idea what went wrong.
var UnspecifiedAPIError = µerror.Error{
Kind: "UnspecifiedAPIError",
}
UnspecifiedAPIError means an API error has occurred which we can't or don't need to categorize any further.
var UpdateCheckFailed = µerror.Error{
Kind: "UpdateCheckFailed",
}
UpdateCheckFailed means that checking for a newer gsctl version failed.
var UserAccountInactiveError = µerror.Error{
Kind: "UserAccountInactiveError",
}
UserAccountInactiveError means that the user account is marked as inative by the API
var WorkersMinMaxInvalidError = µerror.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.
var YAMLFileNotReadableError = µerror.Error{
Kind: "YAMLFileNotReadableError",
}
YAMLFileNotReadableError means a YAML file was not readable
var YAMLNotParseableError = µerror.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 IsAccessForbiddenError ¶
IsAccessForbiddenError asserts AccessForbiddenError
func IsBadRequestError ¶
IsBadRequestError asserts BadRequestError
func IsCannotScaleBelowMinimumWorkersError ¶
IsCannotScaleBelowMinimumWorkersError asserts CannotScaleBelowMinimumWorkersError.
func IsCannotScaleCluster ¶
IsCannotScaleCluster asserts CannotScaleClusterError.
func IsClusterDoesNotSupportNodePools ¶
IsClusterDoesNotSupportNodePools asserts ClusterDoesNotSupportNodePoolsError.
func IsClusterNameOrIDMissingError ¶
IsClusterNameOrIDMissingError asserts ClusterNameOrIDMissingError.
func IsClusterNotFoundError ¶
IsClusterNotFoundError asserts ClusterNotFoundError.
func IsClusterOwnerMissingError ¶
IsClusterOwnerMissingError asserts ClusterOwnerMissingError.
func IsCommandAbortedError ¶
IsCommandAbortedError asserts CommandAbortedError
func IsConflictingFlagsError ¶
IsConflictingFlagsError asserts ConflictingFlagsError.
func IsConflictingWorkerFlagsUsed ¶
IsConflictingWorkerFlagsUsed asserts ConflictingWorkerFlagsUsedError.
func IsCouldNotCreateClientError ¶
IsCouldNotCreateClientError asserts CouldNotCreateClientError.
func IsCouldNotCreateClusterError ¶
IsCouldNotCreateClusterError asserts CouldNotCreateClusterError.
func IsCouldNotCreateJSONRequestBodyError ¶
IsCouldNotCreateJSONRequestBodyError asserts CouldNotCreateJSONRequestBodyError.
func IsCouldNotDeleteClusterError ¶
IsCouldNotDeleteClusterError asserts CouldNotDeleteClusterError.
func IsCouldNotDeleteEndpointError ¶
IsCouldNotDeleteEndpointError asserts CouldNotDeleteEndpointError.
func IsCouldNotScaleClusterError ¶
IsCouldNotScaleClusterError asserts CouldNotScaleClusterError.
func IsCouldNotUpgradeClusterError ¶
IsCouldNotUpgradeClusterError asserts CouldNotUpgradeClusterError
func IsCouldNotWriteFileError ¶
IsCouldNotWriteFileError asserts CouldNotWriteFileError
func IsCredentialNotFoundError ¶
IsCredentialNotFoundError asserts CredentialNotFoundError
func IsCredentialsAlreadySetError ¶
IsCredentialsAlreadySetError asserts CredentialsAlreadySetError.
func IsDesiredEqualsCurrentStateError ¶
IsDesiredEqualsCurrentStateError asserts DesiredEqualsCurrentStateError.
func IsDurationExceededError ¶
IsDurationExceededError asserts DurationExceededError
func IsEmptyPasswordError ¶
IsEmptyPasswordError asserts EmptyPasswordError.
func IsEndpointMissingError ¶
IsEndpointMissingError asserts EndpointMissingError.
func IsEndpointNotFoundError ¶
IsEndpointNotFoundError asserts EndpointNotFoundError.
func IsIncompatibleSettings ¶
IsIncompatibleSettings asserts IncompatibleSettingsError.
func IsInternalServerError ¶
IsInternalServerError asserts InternalServerError.
func IsInvalidCNPrefixError ¶
IsInvalidCNPrefixError asserts InvalidCNPrefixError
func IsInvalidCredentialsError ¶
IsInvalidCredentialsError asserts InvalidCredentialsError
func IsInvalidDurationError ¶
IsInvalidDurationError asserts InvalidDurationError
func IsInvalidNodePoolIDArgument ¶
IsInvalidNodePoolIDArgument asserts InvalidNodePoolIDArgumentError.
func IsInvalidReleaseError ¶
IsInvalidReleaseError asserts InvalidReleaseError.
func IsKubectlMissingError ¶
IsKubectlMissingError asserts KubectlMissingError
func IsNoEmailArgumentGivenError ¶
IsNoEmailArgumentGivenError asserts NoEmailArgumentGivenError
func IsNoResponseError ¶
IsNoResponseError asserts NoResponseError.
func IsNoUpgradeAvailableError ¶
IsNoUpgradeAvailableError asserts NoUpgradeAvailableError
func IsNodePoolIDMalformedError ¶
IsNodePoolIDMalformedError asserts IsNodePoolIDMalformedError.
func IsNodePoolIDMissingError ¶
IsNodePoolIDMissingError asserts NodePoolIDMissingError.
func IsNodePoolNotFound ¶
IsNodePoolNotFound asserts NodePoolNotFoundError.
func IsNotAuthorizedError ¶
IsNotAuthorizedError asserts NotAuthorizedError.
func IsNotEnoughWorkerNodesError ¶
IsNotEnoughWorkerNodesError asserts NotEnoughWorkerNodesError.
func IsNotLoggedInError ¶
IsNotLoggedInError asserts NotLoggedInError.
func IsOrganizationNotFoundError ¶
IsOrganizationNotFoundError asserts OrganizationNotFoundError
func IsOrganizationNotSpecifiedError ¶
IsOrganizationNotSpecifiedError asserts OrganizationNotSpecifiedError
func IsOutputFormatInvalid ¶
IsOutputFormatInvalid asserts OutputFormatInvalidError.
func IsPasswordArgumentNotApplicableError ¶
IsPasswordArgumentNotApplicableError asserts PasswordArgumentNotApplicableError.
func IsProviderNotSupportedError ¶
IsProviderNotSupportedError asserts ProviderNotSupportedError.
func IsReleaseNotFoundError ¶
IsReleaseNotFoundError asserts ReleaseNotFoundError.
func IsReleaseVersionMissingError ¶
IsReleaseVersionMissingError asserts ReleaseVersionMissingError.
func IsRequiredFlagMissingError ¶
IsRequiredFlagMissingError asserts RequiredFlagMissingError.
func IsTokenArgumentNotApplicableError ¶
IsTokenArgumentNotApplicableError asserts TokenArgumentNotApplicableError.
func IsUnspecifiedAPIError ¶
IsUnspecifiedAPIError asserts UnspecifiedAPIError
func IsUpdateCheckFailed ¶
IsUpdateCheckFailed asserts UpdateCheckFailed.
func IsUserAccountInactiveError ¶
IsUserAccountInactiveError asserts UserAccountInactiveError.
func IsWorkersMinMaxInvalid ¶
IsWorkersMinMaxInvalid asserts WorkersMinMaxInvalidError.
func IsYAMLFileNotReadable ¶
IsYAMLFileNotReadable asserts YAMLFileNotReadableError.
func IsYAMLNotParseable ¶
IsYAMLNotParseable asserts YAMLNotParseableError.
Types ¶
This section is empty.