Issue
What is the issue?
application/web/web_main.py registers a global 404 handler that always returns the plain string "Resource Not found". Flask abort(404, "…") descriptions never reach the client.
That includes abort(404, "No such Cache") on production/Heroku map_analysis cache miss, and abort(404, "No object matches the given search terms") on empty text_search.
The Gap Analysis UI reads e.response.data.message. For a string body that field is missing, so the page shows axios’s generic “Request failed with status code 404”.
abort(400/401/503) are unaffected (no custom handlers).
Expected Behaviour
A REST abort(404, "No such Cache") should surface that text to API clients, e.g. JSON {"message": "No such Cache"} for /rest/v1/*. Non-API 404s can stay a simple page.
Actual Behaviour
Every 404 body is "Resource Not found".
Steps to reproduce
- Flask test client,
HEROKU=True, cache miss:
GET /rest/v1/map_analysis?standard=OpenCRE&standard=NIST%20800-53%20v5
- Status is 404 (existing test already checks this).
- Body is
"Resource Not found", not "No such Cache".
Same wipe: GET /rest/v1/text_search?text=no-such-term → 404 "Resource Not found".
Success criteria
Issue
What is the issue?
application/web/web_main.pyregisters a global 404 handler that always returns the plain string"Resource Not found". Flaskabort(404, "…")descriptions never reach the client.That includes
abort(404, "No such Cache")on production/Herokumap_analysiscache miss, andabort(404, "No object matches the given search terms")on emptytext_search.The Gap Analysis UI reads
e.response.data.message. For a string body that field is missing, so the page shows axios’s generic “Request failed with status code 404”.abort(400/401/503)are unaffected (no custom handlers).Expected Behaviour
A REST
abort(404, "No such Cache")should surface that text to API clients, e.g. JSON{"message": "No such Cache"}for/rest/v1/*. Non-API 404s can stay a simple page.Actual Behaviour
Every 404 body is
"Resource Not found".Steps to reproduce
HEROKU=True, cache miss:GET /rest/v1/map_analysis?standard=OpenCRE&standard=NIST%20800-53%20v5"Resource Not found", not"No such Cache".Same wipe:
GET /rest/v1/text_search?text=no-such-term→ 404"Resource Not found".Success criteria
/rest/v1/*404 responses include theabort()description (JSONmessageis enough for the Gap Analysis UI).map_analysisbody containsNo such Cache.make lint/make mypy/make testgreen.