devxerr

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// State/Existence Errors
	CodeVMDormant  = 15
	CodeVMNotFound = 16

	// Execution/Environment Errors
	CodeHostPortInUse = 22

	// Auth/Authentication Errors
	CodeNotLoggedIn = 41

	// Bridge Errors (Idea 46.1)
	CodeBridgeKubeconfigNotFound = 60 // kubeconfig file does not exist
	CodeBridgeContextUnreachable = 61 // cluster context exists but API server is unreachable
	CodeBridgeNamespaceNotFound  = 62 // target namespace does not exist
	CodeBridgeServiceNotFound    = 63 // target service does not exist in namespace
	CodeBridgePortForwardFailed  = 64 // kubectl port-forward crashed or timed out

	// Bridge Intercept Errors (Idea 46.2)
	CodeBridgeAgentDeployFailed       = 65 // Agent Job failed to deploy or reach Running state
	CodeBridgeAgentHealthFailed       = 66 // Agent /healthz did not return 200 within timeout
	CodeBridgeSelectorPatchFailed     = 67 // Failed to patch Service selector
	CodeBridgeRBACInsufficient        = 68 // Insufficient RBAC permissions for intercept
	CodeBridgeInterceptActive         = 69 // Another intercept is already active for this service
	CodeBridgeUnsupportedProtocol     = 70 // Target port uses UDP (not supported in 46.2)
	CodeBridgeTunnelFailed            = 71 // Yamux tunnel failed to establish or dropped
	CodeBridgeServiceNotInterceptable = 72 // Service has no selector or is ExternalName type
)

Variables

This section is empty.

Functions

func RecoverGcloudAuth added in v0.27.1

func RecoverGcloudAuth(output string) bool

RecoverGcloudAuth intercepts a podman/docker stdout/stderr byte array, checks if the google cloud docker credential helper caused the failure, and if so, interactively prompts the user to re-authenticate and auto-runs `gcloud auth login`.

Returns true if the user successfully re-authenticated, indicating the caller should retry the command. Returns false otherwise.

Types

type DevxError

type DevxError struct {
	ExitCode int
	Message  string
	Err      error
}

DevxError wraps a standard error with a stable machine-readable exit code.

func New

func New(code int, msg string, err error) *DevxError

New returns a new predictable exit code error.

func (*DevxError) Error

func (e *DevxError) Error() string

func (*DevxError) Unwrap

func (e *DevxError) Unwrap() error

Unwrap support for errors.Is/As

Jump to

Keyboard shortcuts

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