Documentation
¶
Index ¶
- type ToolError
- func NewArgoError(operation string, cause error) *ToolError
- func NewCiliumError(operation string, cause error) *ToolError
- func NewCommandError(command string, cause error) *ToolError
- func NewHelmError(operation string, cause error) *ToolError
- func NewIstioError(operation string, cause error) *ToolError
- func NewKubernetesError(operation string, cause error) *ToolError
- func NewPrometheusError(operation string, cause error) *ToolError
- func NewSecurityError(operation string, cause error) *ToolError
- func NewTimeoutError(operation string, timeout time.Duration) *ToolError
- func NewToolError(component, operation string, cause error) *ToolError
- func NewValidationError(field, message string) *ToolError
- func (e *ToolError) Error() string
- func (e *ToolError) ToMCPResult() *mcp.CallToolResult
- func (e *ToolError) WithContext(key string, value interface{}) *ToolError
- func (e *ToolError) WithErrorCode(code string) *ToolError
- func (e *ToolError) WithResource(resourceType, resourceName string) *ToolError
- func (e *ToolError) WithRetryable(retryable bool) *ToolError
- func (e *ToolError) WithSuggestions(suggestions ...string) *ToolError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ToolError ¶
type ToolError struct {
Operation string `json:"operation"`
Cause error `json:"cause"`
Suggestions []string `json:"suggestions"`
IsRetryable bool `json:"is_retryable"`
Timestamp time.Time `json:"timestamp"`
ErrorCode string `json:"error_code"`
Component string `json:"component"`
ResourceType string `json:"resource_type,omitempty"`
ResourceName string `json:"resource_name,omitempty"`
Context map[string]interface{} `json:"context,omitempty"`
}
ToolError represents a structured error with context and recovery suggestions
func NewArgoError ¶
NewArgoError creates an Argo-specific error
func NewCiliumError ¶
NewCiliumError creates a Cilium-specific error
func NewCommandError ¶
NewCommandError creates a command execution error
func NewHelmError ¶
NewHelmError creates a Helm-specific error
func NewIstioError ¶
NewIstioError creates an Istio-specific error
func NewKubernetesError ¶
NewKubernetesError creates a Kubernetes-specific error
func NewPrometheusError ¶
NewPrometheusError creates a Prometheus-specific error
func NewSecurityError ¶
NewSecurityError creates a security-related error
func NewTimeoutError ¶
NewTimeoutError creates a timeout error
func NewToolError ¶
NewToolError creates a new structured tool error
func NewValidationError ¶
NewValidationError creates a validation error
func (*ToolError) ToMCPResult ¶
func (e *ToolError) ToMCPResult() *mcp.CallToolResult
ToMCPResult converts the error to an MCP result with rich context
func (*ToolError) WithContext ¶
WithContext adds contextual information to the error
func (*ToolError) WithErrorCode ¶
WithErrorCode sets the error code
func (*ToolError) WithResource ¶
WithResource adds resource information to the error
func (*ToolError) WithRetryable ¶
WithRetryable sets whether the error is retryable
func (*ToolError) WithSuggestions ¶
WithSuggestions adds recovery suggestions to the error