[feat] W@22204269 Release v5.2.0 - Add maintenance mode detection#282
Open
[feat] W@22204269 Release v5.2.0 - Add maintenance mode detection#282
Conversation
unandyala
reviewed
Apr 24, 2026
| this.proxy = config.proxy; | ||
| } | ||
| this.throwOnBadResponse = !!config.throwOnBadResponse; | ||
| this.throwOnMaintenanceHeader = !!config.throwOnMaintenanceHeader; |
Contributor
There was a problem hiding this comment.
Why not just use throwOnBadResponse flag instead of using new flag. when throwOnBadResponse=true, the current code already throws error. We can throw MaintenanceError in this case
Author
There was a problem hiding this comment.
This is actually on purpose to maintain backward compatibility. One may just enable this option while not having exceptions for the other errors.
unandyala
approved these changes
Apr 24, 2026
Contributor
unandyala
left a comment
There was a problem hiding this comment.
overall the changes look good to me. I just left one comment
Add automatic maintenance mode detection via throwOnMaintenanceHeader option. When enabled, the SDK detects maintenance windows by checking the sfdc_maintenance response header and throws MaintenanceError (503) when the value is 'system' or 'site'. Key features: - Opt-in via client configuration (backward compatible) - New MaintenanceError class with detailed error information - Works with all API endpoints - Takes precedence over other error handling - Comprehensive test coverage (100%) Changes: - Add MaintenanceError class and tests - Add throwOnMaintenanceHeader to ClientConfig - Add header check in doFetch() - Export MaintenanceError from helpers - Update README with usage documentation - Update CHANGELOG for v5.2.0 - Bump version to 5.2.0
d4f528f to
af1f58d
Compare
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.
Add automatic maintenance mode detection via throwOnMaintenanceHeader option.
When enabled, the SDK detects maintenance windows by checking the sfdc_maintenance response header and throws MaintenanceError (503) when the value is 'system' or 'site'.
Key features:
Changes: