{"record":{"id":"da08af03ad9af2ca","repo":"DIYgod/RSSHub","slug":"series-not-found","errorCode":null,"errorMessage":"Series not found","messagePattern":"Series not found","errorType":"exception","errorClass":"Error","httpStatus":503,"severity":"error","filePath":"lib/routes/polymarket/series.ts","lineNumber":52,"sourceCode":"    url: 'polymarket.com',\n    maintainers: ['heqi201255'],\n    handler,\n};\n\nasync function handler(ctx) {\n    const slug = ctx.req.param('slug');\n\n    if (slug) {\n        // Get specific series by slug\n        const data = await ofetch<Series[]>(`${GAMMA_API}/series`, {\n            query: {\n                slug,\n                limit: 1,\n            },\n        });\n\n        if (!data.length) {\n            throw new Error('Series not found');\n        }\n\n        const series = data[0];\n        const events = series.events || [];\n\n        const items = events.map((event: Event) => ({\n            title: event.title,\n            description: formatEventDescription(event),\n            link: `https://polymarket.com/event/${event.slug}`,\n            pubDate: event.startDate ? parseDate(event.startDate) : undefined,\n            category: event.tags?.map((t) => t.label).filter(Boolean) as string[],\n        }));\n\n        return {\n            title: `Polymarket Series - ${series.title}`,\n            link: `https://polymarket.com/series/${series.slug}`,\n            item: items,\n        };","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/polymarket/series.ts#L34-L70","documentation":"Plain Error thrown by the Polymarket series handler when the Gamma API returns an empty array for a series query by slug (limit 1). It fires only in the slug-specific branch; an absent slug lists all series instead. Indicates the slug matches no Polymarket series.","triggerScenarios":"Passing a series slug that does not exist (e.g. /polymarket/series/xyz); slug renamed; sport/league slug spelled wrong (nfl/nba/mlb style).","commonSituations":"Slug typo; copied an event slug instead of a series slug; series discontinued; trailing whitespace.","solutions":["Verify the slug at https://polymarket.com/series/{slug}.","Use a known series slug like nfl, nba, or mlb, or omit the slug to list all series.","Ensure you are passing a series slug, not an individual event slug.","Trim whitespace and remove any trailing slash."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function isValidPolymarketSlug(slug: string): boolean {\n  return typeof slug === 'string' && slug.length > 0 && /^[a-z0-9-]+$/.test(slug);\n}\nif (slug && !isValidPolymarketSlug(slug)) {\n  // reject early\n}","typeGuard":"const isNonEmptySeriesArray = (d: unknown): d is Series[] =>\n  Array.isArray(d) && d.length > 0;","tryCatchPattern":"try {\n  const data = await ofetch<Series[]>(`${GAMMA_API}/series`, { query: { slug, limit: 1 } });\n  if (!data.length) throw new Error('Series not found');\n} catch (e) {\n  if (e instanceof Error && e.message === 'Series not found') {\n    // slug invalid: suggest listing all series (omit slug)\n  }\n}","preventionTips":["Validate the series slug format before fetching.","Confirm the slug at polymarket.com/series/{slug}.","Offer the no-slug variant to discover valid series."],"tags":["polymarket","not-found","api","slug","series"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}