Skip to content

Enhance OSM API error messages (Resolves TODO in uiStatus)#12256

Open
GarvSaxena wants to merge 1 commit into
openstreetmap:developfrom
GarvSaxena:fix-api-status-messages
Open

Enhance OSM API error messages (Resolves TODO in uiStatus)#12256
GarvSaxena wants to merge 1 commit into
openstreetmap:developfrom
GarvSaxena:fix-api-status-messages

Conversation

@GarvSaxena

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve OSM API error feedback in uiStatus (Resolve TODO)

1 participant