{"record":{"id":"64f9a791f5810400","repo":"DIYgod/RSSHub","slug":"type-slug-not-found","errorCode":null,"errorMessage":"${type} ${slug} not found","messagePattern":"(.+?) (.+?) not found","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/routes/iplaysoft/utils.ts","lineNumber":11,"sourceCode":"import cache from '@/utils/cache';\nimport ofetch from '@/utils/ofetch';\n\nconst rootUrl = 'https://www.iplaysoft.com/';\n\nconst fetchTaxonomy = async (slug: string, type: 'categories' | 'tags') => {\n    const taxonomyUrl = `${rootUrl}wp-json/wp/v2/${type}?slug=${slug}`;\n    const cachedTaxonomy = await cache.tryGet(taxonomyUrl, async () => {\n        const taxonomyData = await ofetch(taxonomyUrl);\n        if (!taxonomyData[0] || !taxonomyData[0].id || !taxonomyData[0].name) {\n            throw new Error(`${type} ${slug} not found`);\n        }\n        return { id: taxonomyData[0].id, name: taxonomyData[0].name };\n    });\n    return cachedTaxonomy;\n};\n\nconst fetchCategory = async (categorySlug: string) => await fetchTaxonomy(categorySlug, 'categories');\nconst fetchTag = async (tagSlug: string) => await fetchTaxonomy(tagSlug, 'tags');\n\nasync function fetchNewsItems(apiUrl: string) {\n    const data = await ofetch(apiUrl);\n\n    return data.map((item) => ({\n        title: item.title.rendered,\n        description: item.content.rendered,\n        link: item.link,\n        pubDate: new Date(item.date_gmt).toUTCString(),\n        author: item._embedded.author[0].name,","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/iplaysoft/utils.ts#L1-L29","documentation":"Thrown by iplaysoft's `fetchTaxonomy` when the WordPress REST API (`/wp-json/wp/v2/categories?slug=...` or `.../tags?slug=...`) returns no usable taxonomy: the first element is missing, or lacks `id`/`name`. Means the requested category or tag slug does not exist on www.iplaysoft.com (a WordPress site).","triggerScenarios":"User requests `/iplaysoft/category/:slug` or `/iplaysoft/tag/:slug` with a slug that does not correspond to any real WP category/tag; the WP API returns an empty array `[]` or an object without `id`/`name`.","commonSituations":"Typo in the slug; slug is the display name instead of the URL slug (WP slugs are lowercase-hyphenated); the category/tag was renamed or deleted; the site restructured taxonomy.","solutions":["Verify the slug by visiting `https://www.iplaysoft.com/wp-json/wp/v2/categories?slug=<slug>` (or `.../tags?...`) and confirm a non-empty array with an `id`.","Use the slug exactly as it appears in the site's URL (e.g. `/category/pifubao/` -> slug `pifubao`).","If the taxonomy was renamed, find the new slug from the site's category listing page."],"exampleFix":"// before: GET /iplaysoft/category/typo-slug  -> []\n// after: confirm slug via the WP API, then use the real one\nGET /iplaysoft/category/pifubao","handlingStrategy":"validation","validationCode":"const r = await ofetch(taxonomyUrl);\nif (!Array.isArray(r) || !r[0]?.id || !r[0]?.name) {\n  throw new InvalidParameterError(`iplaysoft: ${type} slug '${slug}' not found`);\n}","typeGuard":"const isTaxonomy = (x: any): x is {id:number;name:string} =>\n    x && typeof x.id === 'number' && typeof x.name === 'string';","tryCatchPattern":null,"preventionTips":["Validate the slug against the WP REST API before caching.","Use URL slugs (lowercase-hyphen), not display names.","Cache the taxonomy lookup (it already does) to avoid repeated probes."],"tags":["iplaysoft","wordpress","invalid-parameter","taxonomy"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}