SubscriptionLimitError adds the commands that free a subscription slot to err when it reports the subscription limit, and returns other errors unchanged.
(err error)
| 42 | // SubscriptionLimitError adds the commands that free a subscription slot to err when it reports the subscription |
| 43 | // limit, and returns other errors unchanged. |
| 44 | func SubscriptionLimitError(err error) error { |
| 45 | if !errors.Is(err, client.ErrSubscriptionLimit) { |
| 46 | return err |
| 47 | } |
| 48 | return fmt.Errorf("%w\nTo free a slot, run `gh event subscription list` and delete one with "+ |
| 49 | "`gh event subscription delete <id>`. Deleting a subscription only stops its events, "+ |
| 50 | "and every subscription expires within 24 hours anyway", err) |
| 51 | } |