Improve error logging for npm API failures in analytics job#5
Conversation
- Show actual error messages instead of full error objects - Ensure failed downloads are set to 0 in catch block - Make error messages more informative for debugging Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com>
|
@copilot Had this error - Error fetching release data: Error: Error: 403 rate limit exceeded Error fetching data for npm last-week download: 429 Too Many Requests |
Fixed in 196cfe1. The error logging now shows:
|
Rate limiting errors from npm and GitHub APIs were logged as confusing messages like "Error: Error: 200 OK" or "Error: Error: 403 rate limit exceeded" with no actionable information about which packages failed or why.
Changes
error.messageinstead of full error objects for readable, informative output across all API error handlersgetNpmLastWeekDownloadsnow log which packages failed (theqparameter) for easier debuggingconsole.errorconsistentlygetReleaseDownloadsfunctiongetNpmLastWeekDownloadsfunctionThe script continues processing remaining plugins when individual API calls fail.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.