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

Function isPreviewNotEnabled

pkg/cmd/event/client/client.go:266–276  ·  view source on GitHub ↗
(httpErr api.HTTPError)

Source from the content-addressed store, hash-verified

264}
265
266func isPreviewNotEnabled(httpErr api.HTTPError) bool {
267 if httpErr.HTTPError == nil {
268 return false
269 }
270 for _, item := range httpErr.Errors {
271 if item.Resource == previewNotEnabledResource && item.Code == previewNotEnabledCode {
272 return true
273 }
274 }
275 return strings.Contains(strings.ToLower(httpErr.Message), previewNotEnabledMessage)
276}
277
278// SupportedHost reports whether event subscriptions are available on host. They are only available on github.com,
279// not on GitHub Enterprise Server or GHE.com.

Callers 1

forbiddenErrorFunction · 0.85

Calls 1

ContainsMethod · 0.80

Tested by

no test coverage detected