{"record":{"id":"692668344eaef8b4","repo":"DIYgod/RSSHub","slug":"detail-message","errorCode":null,"errorMessage":"${detail.message}","messagePattern":"\\$\\{detail\\.message\\}","errorType":"exception","errorClass":"Error","httpStatus":503,"severity":"error","filePath":"lib/routes/dxy/board.ts","lineNumber":47,"sourceCode":"async function handler(ctx) {\n    const { boardId } = ctx.req.param();\n    const { limit = '20' } = ctx.req.query();\n\n    const boardDetail = (await cache.tryGet(`dxy:board:detail:${boardId}`, async () => {\n        const detailParams = {\n            boardId,\n            timestamp: Date.now(),\n            noncestr: generateNonce(8, 'number'),\n        };\n\n        const detail = await ofetch(`${phoneBaseUrl}/bbsapi/bbs/board/detail`, {\n            query: {\n                ...detailParams,\n                sign: sign(detailParams),\n            },\n        });\n        if (detail.code !== 'success') {\n            throw new Error(detail.message);\n        }\n        return detail.data;\n    })) as BoardInfo;\n\n    const boardList = (await cache.tryGet(\n        `dxy:board:list:${boardId}`,\n        async () => {\n            const listParams = {\n                boardId,\n                postType: '0',\n                orderType: '1',\n                pageNum: '1',\n                pageSize: limit,\n                timestamp: Date.now(),\n                noncestr: generateNonce(8, 'number'),\n            };\n\n            const recommendList = await ofetch(`${phoneBaseUrl}/bbsapi/bbs/board/post/list`, {","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/dxy/board.ts#L29-L65","documentation":"Thrown by the DXY (Dingxiangyuan) board detail API call when the response `code` field is not 'success'. The route calls the `/bbsapi/bbs/board/detail` endpoint with signed parameters (HMAC-style signature). If the API rejects the request (invalid boardId, expired signature, server error), it returns a non-success code with a `message` field describing the error, which is re-thrown verbatim.","triggerScenarios":"The boardId doesn't exist or has been removed; the request signature (`sign()`) is invalid due to a clock skew or algorithm change; the API server is under maintenance; rate limiting returns an error code with a message.","commonSituations":"Incorrect boardId from an outdated URL; the signing algorithm or secret has been rotated by DXY; server-side rate limiting or temporary outage.","solutions":["Verify the boardId by visiting the corresponding DXY BBS board page.","Retry — the error may be transient (rate limiting or maintenance).","If the signing algorithm changed, check for RSSHub updates to the sign() function.","Inspect the thrown message for the specific upstream error reason."],"exampleFix":"// before\nif (detail.code !== 'success') {\n    throw new Error(detail.message);\n}\n\n// after — include request context\nif (detail.code !== 'success') {\n    throw new Error(`DXY board detail API error (boardId=${boardId}, code=${detail.code}): ${detail.message}`);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"interface DxyApiResponse<T> {\n    code: string;\n    message: string;\n    data: T;\n}\n\nfunction isDxySuccess<T>(resp: DxyApiResponse<T>): resp is DxyApiResponse<T> & { code: 'success' } {\n    return resp.code === 'success';\n}","tryCatchPattern":"try {\n    const feed = await fetch(`${rsshubUrl}/dxy/bbs/board/${boardId}`);\n} catch (e) {\n    // The error message is the upstream API's message field\n    console.error(`DXY board detail API error for boardId ${boardId}: ${e.message}`);\n    if (e.message.includes('sign') || e.message.includes('签名')) {\n        // Signature issue — may need RSSHub update\n    }\n    throw e;\n}","preventionTips":["Verify the boardId by visiting the DXY BBS board page in a browser.","Retry after a delay — DXY API errors can be transient.","If the error mentions signature/signing, the signing algorithm may have changed — check for RSSHub updates.","Inspect the upstream message for the specific error reason."],"tags":["dxy","api-error","signed-request","response-validation","bbs"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}