errors

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnhanceAPIError

func EnhanceAPIError(err error, ctx APIErrorContext) error

EnhanceAPIError enhances an API error with context and helpful hints

func ExtractStatusCodeFromError

func ExtractStatusCodeFromError(err error) int

ExtractStatusCodeFromError attempts to extract HTTP status code from an error

func FormatConfigurationError

func FormatConfigurationError(filePath string, lineNumber int, issue string) error

FormatConfigurationError formats configuration parsing errors with file context

func FormatDependencyError

func FormatDependencyError(resourceType, resourceName, dependencyType, dependencyRef string) error

FormatDependencyError formats dependency resolution errors

func FormatNetworkError

func FormatNetworkError(operation, resourceType, resourceName string, err error) error

FormatNetworkError formats network-related errors with retry suggestions

func FormatProtectionError

func FormatProtectionError(resourceType, resourceName, operation string) error

FormatProtectionError formats protection violation errors

func FormatResourceError

func FormatResourceError(operation, resourceType, resourceName, namespace string, err error) error

FormatResourceError creates a formatted error message with resource context

func FormatValidationError

func FormatValidationError(resourceType, resourceName, field, issue string) error

FormatValidationError formats validation errors with clear context

func IsAuthError

func IsAuthError(_ error, statusCode int) bool

IsAuthError checks if an error indicates authentication/authorization failure

func IsConflictError

func IsConflictError(err error, statusCode int) bool

IsConflictError checks if an error indicates a resource conflict (name already exists)

func IsRateLimitError

func IsRateLimitError(_ error, statusCode int) bool

IsRateLimitError checks if an error indicates rate limiting

func IsValidationError

func IsValidationError(err error, statusCode int) bool

IsValidationError checks if an error indicates validation failure

func WithResourceContext

func WithResourceContext(err error, ctx ResourceContext) error

WithResourceContext adds resource context to an error

Types

type APIErrorContext

type APIErrorContext struct {
	ResourceType string
	ResourceName string
	Namespace    string
	Operation    string
	StatusCode   int
	ResponseBody string
}

APIErrorContext provides context for API-related errors

type ResourceContext

type ResourceContext struct {
	ResourceType string
	ResourceName string
	Namespace    string
	Operation    string
}

ResourceContext provides context information for errors

Jump to

Keyboard shortcuts

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