agents/errors.go

gentle-ai · internal/agents/errors.go · go · MIT
ai, tag:embed-classified

Custom error types for agent capability and support checks.

// Source: https://github.com/Gentleman-Programming/gentle-ai | License: MIT | Copyright 2025 Gentleman Programming
// Provided via justclaw.it.com; keep this notice with the code.
package agents

import (
	"errors"
	"fmt"

	"github.com/gentleman-programming/gentle-ai/v4/internal/model"
)

var (
	ErrCapabilityNotSupported = errors.New("capability not supported")
	ErrAgentNotSupported      = errors.New("agent not supported")
	ErrDuplicateAdapter       = errors.New("adapter already registered")
)

type CapabilityNotSupportedError struct {
	Agent      model.AgentID
	Capability Capability
}

func (e CapabilityNotSupportedError) Error() string {
	return fmt.Sprintf("agent %q does not support capability %q", e.Agent, e.Capability)
}

func (e CapabilityNotSupportedError) Is(target error) bool {
	

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key