{"modulePath":"github.com/onexstack/onex","version":"v0.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\nPackage errors makes a set of error message handlers available for use by cloud miner.\n\n## Types\n\n```go\ntype MinerError struct {\n\tReason  MinerStatusError\n\tMessage string\n}\n```\nMinerError is a more descriptive kind of error that represents an error condition that should be set in the Miner.Status. The \"Reason\" field is meant for short, enum-style constants meant to be interpreted by miners. The \"Message\" field is meant to be read by humans.\n\n```go\nfunc CreateMiner(msg string, args ...any) *MinerError\n```\nCreateMiner creates a new error for when creating a Miner.\n\n```go\nfunc DeleteMiner(msg string, args ...any) *MinerError\n```\nDeleteMiner creates a new error for when deleting a Miner.\n\n```go\nfunc InvalidMinerConfiguration(msg string, args ...any) *MinerError\n```\nInvalidMinerConfiguration creates a new error when a Miner has invalid configuration.\n\n```go\nfunc UpdateMiner(msg string, args ...any) *MinerError\n```\nUpdateMiner creates a new error for when updating a Miner.\n\n```go\nfunc (e *MinerError) Error() string\n```\n\n```go\ntype MinerSetStatusError string\n```\nMinerSetStatusError defines errors states for MinerSet objects.\n\n```go\nconst (\n\t// InvalidConfigurationMinerSetError represents\n\t// the combination of configuration in the MinerTemplateSpec\n\t// is not supported by this cluster. This is not a transient error, but\n\t// indicates a state that must be fixed before progress can be made.\n\t//\n\t// Example: the ProviderSpec specifies an instance type that doesn't exist.\n\tInvalidConfigurationMinerSetError MinerSetStatusError = \"InvalidConfiguration\"\n)\n```\n\n```go\nfunc MinerSetStatusErrorPtr(v MinerSetStatusError) *MinerSetStatusError\n```\nMinerSetStatusErrorPtr converts a MinerSetStatusError to a pointer.\n\n```go\ntype MinerStatusError string\n```\nMinerStatusError defines errors states for Miner objects.\n\n```go\nconst (\n\t// InvalidConfigurationMinerError represents that the combination\n\t// of configuration in the MinerSpec is not supported by this cluster.\n\t// This is not a transient error, but\n\t// indicates a state that must be fixed before progress can be made.\n\t//\n\t// Example: the ProviderSpec specifies an instance type that doesn't exist,.\n\tInvalidConfigurationMinerError MinerStatusError = \"InvalidConfiguration\"\n\n\t// UnsupportedChangeMinerError indicates that the MinerSpec has been updated in a way that\n\t// is not supported for reconciliation on this cluster. The spec may be\n\t// completely valid from a configuration standpoint, but the controller\n\t// does not support changing the real world state to match the new\n\t// spec.\n\t//\n\t// Example: the responsible controller is not capable of changing the\n\t// container runtime from docker to rkt.\n\tUnsupportedChangeMinerError MinerStatusError = \"UnsupportedChange\"\n\n\t// InsufficientResourcesMinerError generally refers to exceeding one's quota in a cloud provider,\n\t// or running out of physical miners in an on-premise environment.\n\tInsufficientResourcesMinerError MinerStatusError = \"InsufficientResources\"\n\n\t// CreateMinerError indicates an error while trying to create a Node to match this\n\t// Miner. This may indicate a transient problem that will be fixed\n\t// automatically with time, such as a service outage, or a terminal\n\t// error during creation that doesn't match a more specific\n\t// MinerStatusError value.\n\t//\n\t// Example: timeout trying to connect to GCE.\n\tCreateMinerError MinerStatusError = \"CreateError\"\n\n\t// UpdateMinerError indicates an error while trying to update a Node that this\n\t// Miner represents. This may indicate a transient problem that will be\n\t// fixed automatically with time, such as a service outage,\n\t//\n\t// Example: error updating load balancers.\n\tUpdateMinerError MinerStatusError = \"UpdateError\"\n\n\t// DeleteMinerError indicates an error was encountered while trying to delete the Node that this\n\t// Miner represents. This could be a transient or terminal error, but\n\t// will only be observable if the provider's Miner controller has\n\t// added a finalizer to the object to more gracefully handle deletions.\n\t//\n\t// Example: cannot resolve EC2 IP address.\n\tDeleteMinerError MinerStatusError = \"DeleteError\"\n\n\t// JoinClusterTimeoutMinerError indicates that the miner did not join the cluster\n\t// as a new node within the expected timeframe after instance\n\t// creation at the provider succeeded\n\t//\n\t// Example use case: A controller that deletes Miners which do\n\t// not result in a Node joining the cluster within a given timeout\n\t// and that are managed by a MinerSet.\n\tJoinClusterTimeoutMinerError = \"JoinClusterTimeoutError\"\n)\n```\n\n```go\nfunc MinerStatusErrorPtr(v MinerStatusError) *MinerStatusError\n```\nMinerStatusErrorPtr converts a MinerStatusError to a pointer.\n\n","path":"github.com/onexstack/onex/pkg/errors","name":"errors","synopsis":"Package errors makes a set of error message handlers available for use by cloud miner.","isRedistributable":true}
