{"record":{"id":"410400ae4b171d38","repo":"DIYgod/RSSHub","slug":"invalid-tag-slug-slug","errorCode":null,"errorMessage":"Invalid tag slug: ${slug}","messagePattern":"Invalid tag slug: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":503,"severity":"error","filePath":"lib/routes/misskon/utils.ts","lineNumber":32,"sourceCode":"        $('input').each((_, el) => {\n            $(el).replaceWith($(el).attr('value') || '');\n        });\n        return {\n            title: item.title.rendered,\n            link: item.link,\n            description: $.html(),\n            pubDate: timezone(parseDate(item.date_gmt), 0),\n            category: item._embedded['wp:term']\n                .flat()\n                .filter((x) => x.taxonomy === 'post_tag')\n                .map((x) => x.name),\n        };\n    });\n};\nconst getTags = async (slug) => {\n    const data = await ofetch(`${ENDPOINT}/tags?slug=${slug}`);\n    if (data.length === 0) {\n        throw new Error(`Invalid tag slug: ${slug}`);\n    }\n    return {\n        id: data[0].id,\n        name: data[0].name,\n        link: data[0].link,\n        description: data[0].description,\n    };\n};\nexport { ENDPOINT, getPosts, getTags };\n","sourceCodeStart":14,"sourceCodeEnd":42,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/misskon/utils.ts#L14-L42","documentation":"Thrown by getTags() in the MissKON utils when the WordPress REST API at misskon.com/wp-json/wp/v2/tags?slug=<slug> returns an empty array — meaning no tag with that slug exists. It is a bare `throw new Error`. getTags is shared by tag-based routes; the slug comes from the :slug path parameter.","triggerScenarios":"A route calls getTags(slug); the WP tags endpoint responds with [] (HTTP 200 but empty). This happens when the slug is misspelled, the tag was renamed/deleted, or the slug uses a different casing than stored.","commonSituations":"User copies a tag slug from a URL but it's actually the tag's display name, not its slug; the site renamed the tag; case-sensitivity mismatch (WP slugs are lowercase).","solutions":["Look up the correct slug on misskon.com: open the tag page and copy the last URL path segment (it is lowercase and hyphenated).","Verify the slug directly: `curl 'https://misskon.com/wp-json/wp/v2/tags?slug=<slug>'` — a non-empty array means the slug is valid.","If maintaining the route, switch the bare Error to a NotFoundError for a cleaner client response."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const data = await ofetch(`${ENDPOINT}/tags?slug=${encodeURIComponent(slug)}`);\nif (!Array.isArray(data) || data.length === 0) {\n    throw new InvalidParameterError(`No MissKON tag with slug '${slug}'. Check the tag page URL for the correct (lowercase) slug.`);\n}","typeGuard":"function isTagArray(data: unknown): data is { id: number; name: string; link: string; description: string }[] {\n    return Array.isArray(data) && data.length > 0 && typeof data[0]?.id === 'number';\n}","tryCatchPattern":null,"preventionTips":["Always copy the slug from the tag's page URL (lowercase, hyphenated), not its display name.","URL-encode the slug when building the WP REST query.","Switch the bare Error to a typed NotFoundError for cleaner client handling."],"tags":["invalid-parameter","wordpress-rest-api","slug","not-found","misskon"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}