Repository navigation
Return proper status codes from the address lookup endpoint - #741
Merged
marcvergees merged 1 commit intoOct 25, 2026
Merged
Conversation
Reject blank addresses with 422 instead of querying Nominatim, and report Nominatim errors as 502 GEOCODING_FAILED and timeouts as 504 GEOCODING_TIMEOUT instead of 500 / a generic error code. Fixes fireform-core#740
10 of 14 tasks
marcvergees
approved these changes
Oct 25, 2026
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
GET /zipcode/lookup-addressreported client mistakes and Nominatim outages as FireForm server errors. This fixes the status and error codes in the route; the geocoding service itself is unchanged.address=(empty)200 []422VALIDATION_ERROR, fieldquery.addressaddress=%20%20%20(only spaces)500INTERNAL_ERROR422VALIDATION_ERROR, Nominatim not calledGeocoderServiceError)500INTERNAL_ERROR502GEOCODING_FAILED504witherror_code: "ERROR"504GEOCODING_TIMEOUT200200(unchanged)RequestValidationError, the same wayweather.pyandinput.pyreject bad input.GeocoderServiceErrorintoRuntimeErrorandGeocoderTimedOutintoTimeoutError; the route now maps those to 502 / 504 with specific error codes. Any other exception is still a 500.No frontend change needed: the address lookup modal already shows the backend's
message.Fixes #740
Type of change
How Has This Been Tested?
TestZipcodeEndpointsintests/test_api.py(there were no zipcode tests before), with Nominatim mocked:""and" ") → 422 and Nominatim is never calledGeocoderServiceError→ 502GEOCODING_FAILEDGeocoderTimedOut→ 504GEOCODING_TIMEOUT[]developmentthe first four fail and the last passespython -m pytest tests/→ 318 passedruff check app/→ all checks passedTest Configuration:
Checklist: