{"record":{"id":"78b9f643cfa290c3","repo":"DIYgod/RSSHub","slug":"error-78b9f6","errorCode":null,"errorMessage":"日报数据不存在或为空","messagePattern":"日报数据不存在或为空","errorType":"exception","errorClass":"Error","httpStatus":503,"severity":"error","filePath":"lib/routes/aibase/daily.ts","lineNumber":38,"sourceCode":"        const currentHtml = await ofetch(currentUrl);\n        const $ = load(currentHtml);\n        const logoSrc = $('img.logo').prop('src');\n        const image = logoSrc ? new URL(logoSrc, rootUrl).href : '';\n        const author = 'AI Base';\n        const { aILogListUrl } = await buildApiUrl($);\n        const response: DailyData = await ofetch(aILogListUrl, {\n            headers: {\n                accept: 'application/json;charset=utf-8',\n            },\n            query: {\n                pagesize: limit,\n                page: 1,\n                type: 2,\n                isen: 0,\n            },\n        });\n        if (!response || !response.data) {\n            throw new Error('日报数据不存在或为空');\n        }\n        const items = await Promise.all(\n            response.data.slice(0, limit).map(async (item) => {\n                const articleUrl = `https://www.aibase.com/zh/news/${item.Id}`;\n                return await cache.tryGet(articleUrl, async () => {\n                    const articleHtml = await ofetch(articleUrl);\n                    const $ = load(articleHtml);\n                    const description = $('.post-content').html();\n                    if (!description) {\n                        throw new Error(`Empty content: ${articleUrl}`);\n                    }\n                    return {\n                        title: item.title,\n                        link: articleUrl,\n                        description,\n                        pubDate: parseDate(item.addtime),\n                        author: 'AI Base',\n                    };","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/aibase/daily.ts#L20-L56","documentation":"The AI Base daily route queries an aILogList endpoint and expects `response.data` to be a non-empty array. If the response is falsy or has no `data` property, it throws a generic `Error('日报数据不存在或为空')`. This is a defensive guard against malformed/empty upstream payloads.","triggerScenarios":"The aILogList API returns an error envelope, an empty payload, or an HTML error page (rate-limit / WAF) that ofetch coerced into an object lacking `data`.","commonSituations":"Rate-limited by aibase.com; the endpoint path or query contract changed; a WAF/challenge page returned non-JSON.","solutions":["Retry later — most often this is a transient rate-limit.","Verify the aILogListUrl still returns the expected shape (open it directly).","Inspect the ofetch response status / content-type to distinguish 'empty' from 'blocked'."],"exampleFix":"// before\nconst response: DailyData = await ofetch(aILogListUrl, { ... });\nif (!response || !response.data) throw new Error('日报数据不存在或为空');\n// after — surface why it failed\nif (!response || !response.data) {\n    throw new Error(`aibase daily empty: status=${response?.status ?? 'n/a'}, keys=${Object.keys(response ?? {}).join(',')}`);\n}","handlingStrategy":"retry","validationCode":"function looksLikeAibaseDaily(r) {\n  return r != null && Array.isArray(r.data) && r.data.length > 0;\n}","typeGuard":"function isAibaseDailyPayload(r): r is { data: unknown[] } {\n  return !!r && Array.isArray((r as any).data) && (r as any).data.length > 0;\n}","tryCatchPattern":"let lastErr;\nfor (let attempt = 0; attempt < 3; attempt++) {\n  try {\n    const response = await ofetch(aILogListUrl, { query: { pagesize: limit, page: 1, type: 2, isen: 0 }, headers: { accept: 'application/json;charset=utf-8' } });\n    if (isAibaseDailyPayload(response)) return response;\n    lastErr = new Error('aibase daily empty: ' + JSON.stringify(Object.keys(response ?? {})));\n  } catch (e) { lastErr = e; }\n  await sleep(1000 * 2 ** attempt); // backoff\n}\nthrow lastErr;","preventionTips":["Rate-limit your polling of the aibase daily endpoint.","Inspect HTTP status and content-type to distinguish 'empty' from 'blocked'.","Cache successful responses with a TTL so transient failures don't cascade."],"tags":["upstream-dependent","network","rate-limit","rsshub","error-class-mismatch"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}