(httpErr api.HTTPError)
| 264 | } |
| 265 | |
| 266 | func 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. |
no test coverage detected