Enhance OSM API error messages (Resolves TODO in uiStatus)#12256
Open
GarvSaxena wants to merge 1 commit into
Open
Enhance OSM API error messages (Resolves TODO in uiStatus)#12256GarvSaxena wants to merge 1 commit into
GarvSaxena wants to merge 1 commit into
Conversation
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.
This PR resolves a TODO in modules/ui/status.js by providing more specific UI feedback when the OSM API fails, rather than falling back to the generic error message for all connection issues.
I added logic to check the error's HTTP status code and display a specific message for 500 errors, 503 errors, and network timeouts. If an unrecognized error occurs, it still safely falls back to the original generic error message.
Changes
modules/ui/status.js: Updated the update function to check err.status and select the appropriate translation key. Removed the old TODO comment.
data/core.yaml: Added server_error, service_unavailable, and timeout localization strings under osm_api_status.message.
Closes #12255