-
Notifications
You must be signed in to change notification settings - Fork 406
Improves error handling when rate limiting is disabled on GHES. #1300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improves error handling when rate limiting is disabled on GHES. #1300
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves error handling in the getRateLimit method to gracefully handle GitHub Enterprise Server (GHES) instances where rate limiting is disabled, addressing issue #1227.
Key Changes:
- Added specific handling for 404 errors indicating rate limiting is not enabled
- Ensured consistent
undefinedreturn value across all error paths
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ded simple type narrowing for status and message.
…ons#1300) * rateLimitResult log * code update for rate limit * Refactor getRateLimit method to remove mock responses and improve error handling * retry logic removed * Simplify warning message for rate limiting not enabled * Remove redundant comments in rate limiting error handling * updated the block to use catch (error: unknown) instead of any and added simple type narrowing for status and message.
Description:
This pull request improves the error handling logic in the
getRateLimitmethod of theIssuesProcessorclass to better support environments where GitHub rate limiting is not enabled, such as some GitHub Enterprise Server (GHES) instances.Error handling improvements for rate limiting:
catchblock in thegetRateLimitmethod to specifically check for a 404 error with a message indicating that rate limiting is not enabled, logging a warning and proceeding gracefully without rate limit checks. For all other errors, an error is logged and the method returnsundefinedto ensure consistent fallback behavior.Related issue:
#1227
Check list: