errors.go 1.3 KB

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