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