{"record":{"id":"5788a1dff7583aac","repo":"diegosouzapw/OmniRoute","slug":"skills-sh-api-error-res-status-body","errorCode":null,"errorMessage":"skills.sh API error: ${res.status} ${body}","messagePattern":"skills\\.sh API error: (.+?) (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/skills/skillssh.ts","lineNumber":44,"sourceCode":"const REQUEST_TIMEOUT_MS = 15_000;\n\n/**\n * Search the skills.sh public directory.\n * No authentication required.\n */\nexport async function searchSkillsSh(\n  query: string,\n  limit: number = DEFAULT_SEARCH_LIMIT\n): Promise<SkillsShSearchResponse> {\n  const url = `${SKILLSSH_BASE_URL}/search?q=${encodeURIComponent(query)}&limit=${limit}`;\n  const controller = new AbortController();\n  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);\n\n  try {\n    const res = await fetch(url, { signal: controller.signal });\n    if (!res.ok) {\n      const body = await res.text();\n      throw new Error(`skills.sh API error: ${res.status} ${body}`);\n    }\n    const data = await res.json();\n    return SkillsShSearchResponseSchema.parse(data);\n  } finally {\n    clearTimeout(timeout);\n  }\n}\n\n/**\n * Fetch SKILL.md content from GitHub for a skills.sh skill.\n *\n * @param source - GitHub \"owner/repo\" (e.g. \"supabase/agent-skills\")\n * @param skillId - Skill name (last segment of the full id, e.g. \"supabase-postgres-best-practices\")\n */\nexport async function fetchSkillMd(source: string, skillId: string): Promise<string> {\n  const url = `${GITHUB_RAW_BASE}/${source}/main/skills/${skillId}/SKILL.md`;\n  const controller = new AbortController();\n  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/skills/skillssh.ts#L26-L62","documentation":"Error \"skills.sh API error: ${res.status} ${body}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/skills/skillssh.ts:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}