errors.go

 1package server
 2
 3import (
 4	"errors"
 5	"fmt"
 6)
 7
 8var (
 9	// Common server errors
10	ErrUnsupported      = errors.New("not supported")
11	ErrResourceNotFound = errors.New("resource not found")
12	ErrPromptNotFound   = errors.New("prompt not found")
13	ErrToolNotFound     = errors.New("tool not found")
14
15	// Session-related errors
16	ErrSessionNotFound              = errors.New("session not found")
17	ErrSessionExists                = errors.New("session already exists")
18	ErrSessionNotInitialized        = errors.New("session not properly initialized")
19	ErrSessionDoesNotSupportTools   = errors.New("session does not support per-session tools")
20	ErrSessionDoesNotSupportLogging = errors.New("session does not support setting logging level")
21
22	// Notification-related errors
23	ErrNotificationNotInitialized = errors.New("notification channel not initialized")
24	ErrNotificationChannelBlocked = errors.New("notification channel full or blocked")
25)
26
27// ErrDynamicPathConfig is returned when attempting to use static path methods with dynamic path configuration
28type ErrDynamicPathConfig struct {
29	Method string
30}
31
32func (e *ErrDynamicPathConfig) Error() string {
33	return fmt.Sprintf("%s cannot be used with WithDynamicBasePath. Use dynamic path logic in your router.", e.Method)
34}