MCPcopy Create free account
hub / github.com/cli/cli / forbiddenError

Function forbiddenError

pkg/cmd/event/client/client.go:246–252  ·  view source on GitHub ↗

forbiddenError tells a 403 response for an account without preview access apart from other denials. It keeps the HTTP error wrapped, so callers treat it as final rather than retrying it.

(httpErr api.HTTPError, err error)

Source from the content-addressed store, hash-verified

244// forbiddenError tells a 403 response for an account without preview access apart from other denials. It keeps the
245// HTTP error wrapped, so callers treat it as final rather than retrying it.
246func forbiddenError(httpErr api.HTTPError, err error) error {
247 // This check is temporary and can be removed once event subscriptions are enabled for all users.
248 if httpErr.HTTPError != nil && httpErr.Message == previewNotEnabledMessage {
249 return fmt.Errorf("%w: %w", ErrPreviewNotEnabled, err)
250 }
251 return fmt.Errorf("access forbidden: %w", err)
252}
253
254// SupportedHost reports whether event subscriptions are available on host. They are only available on github.com,
255// not on GitHub Enterprise Server or GHE.com.

Callers 5

CreateSubscriptionMethod · 0.85
GetSubscriptionMethod · 0.85
ListSubscriptionsMethod · 0.85
DeleteSubscriptionMethod · 0.85
OpenStreamMethod · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected