MCPcopy Create free account
hub / github.com/massCodeIO/massCode / getGistRequestErrorMessage

Function getGistRequestErrorMessage

src/main/import/snippets/githubGists.ts:83–97  ·  view source on GitHub ↗
(status: number, headers: Headers)

Source from the content-addressed store, hash-verified

81const GIST_FETCH_TIMEOUT_MS = 15_000
82
83function getGistRequestErrorMessage(status: number, headers: Headers): string {
84 if (status === 403 && headers.get('x-ratelimit-remaining') === '0') {
85 return 'GitHub Gist rate limit reached. Try again later.'
86 }
87
88 if (status === 401 || status === 403) {
89 return 'GitHub Gist import supports public Gists only; private or rate-limited Gists require authentication'
90 }
91
92 if (status === 404) {
93 return 'GitHub Gist was not found or is not public'
94 }
95
96 return `GitHub Gist request failed with status ${status}`
97}
98
99export function parseGitHubGistResponse(
100 gist: GitHubGistResponse,

Callers 1

fetchGitHubGistImportFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected