errors.go 498 B

123456789101112131415161718
  1. package agent
  2. import (
  3. "context"
  4. "errors"
  5. )
  6. var (
  7. ErrRequestCancelled = errors.New("request canceled by user")
  8. ErrSessionBusy = errors.New("session is currently processing another request")
  9. ErrEmptyPrompt = errors.New("prompt is empty")
  10. ErrSessionMissing = errors.New("session id is missing")
  11. ErrHookCancellation = errors.New("hook cancelled the agent")
  12. )
  13. func isCancelledErr(err error) bool {
  14. return errors.Is(err, context.Canceled) || errors.Is(err, ErrRequestCancelled)
  15. }