fix(route/youtube): surface quota errors instead of returning undefined - #23133
Conversation
|
Successfully generated as following: http://localhost:1200/youtube/live/@GawrGura - Failed ❌ |
|
Successfully generated as following: http://localhost:1200/youtube/live/@GawrGura - Failed ❌ |
|
Route test above fails with The change is only in the key-rotation helper's error path; the old/new comparison table in the description is how I verified it. |
|
Gentle ping — open for two weeks now. The only red check is the route test, which needs a YOUTUBE_KEY the CI doesn't have; the change itself only turns an exhausted-quota response into a readable error instead of the current TypeError on undefined. Happy to rebase or adjust anything if you'd rather take a different approach. |
|
Successfully generated as following: http://localhost:1200/youtube/live/@GawrGura - Failed ❌ |
Involved Issue / 该 PR 相关 Issue
Ref #22971
Example for the Proposed Route(s) / 路由地址示例
New RSS Route Checklist / 新 RSS 路由检查表
PuppeteerNot a new route; fixes the shared YouTube error path.
Note / 说明
Second ask in #22971: show
quotaExceededinstead of aTypeErroronce the quota is gone.The
exechelper in the Google API wrapper rotates through the keys and swallows every failure, so with all keys exhausted it returnsundefinedand the route dies reading.dataoff that withCannot read properties of undefined, which says nothing about quota.Now, when every key failed and the last error carries a Google quota reason (
quotaExceeded,dailyLimitExceeded,rateLimitExceeded,userRateLimitExceeded), it is rethrown so the error page shows the real 403 message. Key rotation is untouched, and other failures still returnundefinedon purpose —getDataByUsernamereads that as "no content".Old vs. new
execagainst the gaxios error shape:quotaExceededTypeErrorplaylistNotFoundTypeErrorTypeErrorCache interval is left alone: #21853 set it deliberately. The route test will show
ConfigNotFoundErrorsince CI has noYOUTUBE_KEY.Replaces #23132 (auto-closed for description length); same change.