Improves error handling when rate limiting is disabled on GHES.#1300
Merged
HarithaVattikuti merged 7 commits intoactions:mainfrom Nov 5, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
priyagupta108
approved these changes
Nov 3, 2025
aparnajyothi-y
approved these changes
Nov 3, 2025
HarithaVattikuti
approved these changes
Nov 5, 2025
This was referenced Nov 7, 2025
Closed
jayudey-wf
pushed a commit
to jayudey-wf/stale
that referenced
this pull request
Dec 4, 2025
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: