templates: every generated page routes a failure through the shared refusal gate (#7263) - #7271
Open
delchev wants to merge 1 commit into
Open
templates: every generated page routes a failure through the shared refusal gate (#7263)#7271delchev wants to merge 1 commit into
delchev wants to merge 1 commit into
Conversation
…efusal gate (#7263) #7259 (#7242) gave the personal/partner form and document pages an applyApiError and left the rest of the generated pages on the raw e.message - the developer- facing text of ApiError, which with spring.web.error.include-message=always is a 500's Hibernate/JDBC sentence (#7151): - the administration page, listed in #7242's evidence, concatenated 'HTTP <status>: ' + body.message with no status gate at all, with a comment saying an admin wants the raw truth; - the personal/partner list and the personal calendar loads kept `(e && e.message) || 'Could not load ...'`, although the PR said every remaining load path had moved; - the standalone report page and the task form had the same shape, each with its own fetch client. Every one of them now goes through App.services.apiErrors.refusalMessageFor: the server's text is quoted only for a 400/409 that is one short sentence without markup, everything else keeps the neutral fallback. The admin, report and task-form pages are standalone, so they load apiError.js from application-core by absolute URL - it depends on nothing but window.App - and hand the gate an { httpStatus, errorMessage } shaped like ApiError; the raw text goes to console.error, on the admin surface too. The admin banner now distinguishes a refusal it may show (err.shown) from a transport failure, whose own message is developer-facing like any other. IntentEmissionCoverageIT no longer names four files: it walks EVERY emitted .js/.html under gen/ and fails on `(e && e.message)` / `String(e.message`, so a page a template adds later cannot fall outside the check by not being named. The harmonia-ui guide records the rule and the five rounds it took to reach every surface. Verified: mvn -T 1C formatter:validate (cache wiped) green; quick-build install of the worktree; IntentEmissionCoverageIT green (it renders and compiles the generated project, so the changed templates are exercised through Velocity). Fixes #7263 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Summary
e.message- the developer-facing text, which on a 500 is the Hibernate/JDBC sentence (ui: a 500 whose message quotes a field name is mapped onto the form field verbatim #7151). Still raw onorigin/master: the admin page (listed in templates: the personal/partner form save and document header save still show the raw e.message and mark no field - #7151/#7152 reached the helper and the line dialogs only #7242's evidence;'HTTP ' + status + ': ' + body.messagewith no status gate), the my/partner list + my calendar loads (contrary to the PR body's "every remaining load path"), and - same shape, found by the widened check - the standalone report page and the task form.App.services.apiErrors.refusalMessageFor: the server's text is quoted only for a 400/409 that is one short sentence without markup, anything else keeps the neutral fallback. The three standalone pages (admin, report, task form) loadapiError.jsfromapplication-coreby absolute URL - it depends only onwindow.App, which the report/form pages already bootstrap fori18n.js- and hand the gate an{ httpStatus, errorMessage }shaped likeApiError. The developer-facing text goes toconsole.error, on the admin surface too (the "raw truth" is one keystroke away and in the server log anyway).IntentEmissionCoverageITstops naming four files: it walks every emitted.js/.htmlundergen/and fails on(e && e.message)/String(e.message, plus positive checks that the admin page loads the gate and routes through it and that the three list/calendar loads use the helper. The harmonia-ui guide gets the rule.Test plan
mvn -T 1C formatter:validatewith the formatter cache wiped -BUILD SUCCESS(175 files in tests-integrations processed)mvn -T 1C -P quick-build install -DskipTestsof the worktreeIntentEmissionCoverageITgreen - it generates, renders (Velocity) and compiles the whole emission project, so every changed template is exercised and the new walk runs over the real outputHTTP 500 - the server log has the reason.), which no IT drives - the same source-text-plus-render bar templates: give the my/partner form and document header save an applyApiError (#7242) #7259 usedFixes #7263
🤖 Generated with Claude Code