templates: route the task form's COMPLETE catch through apiErrors, not raw e.message (#7296) - #7315
Open
nedelcho-delchev-tues wants to merge 1 commit into
Conversation
…t raw e.message (eclipse-dirigible#7296) eclipse-dirigible#7271/eclipse-dirigible#7263 routed the admin page, the my/partner list and calendar loads, the report page and the generic submit() through apiErrors.refusalMessageFor - but not the path every process user task actually takes. FormIntentGenerator's generated COMPLETE catch read `error.data.message`, and the $http compat shim in template-form-builder-harmonia's form.js.template collapsed a caught error into `{ data: { message: e.message } }` before that, discarding httpStatus/ errorMessage entirely - so a 500 from POST /services/inbox/tasks/{id} (a repository throwing inside a check gate, a constraint the 409 mapper does not know) printed the raw Hibernate/JDBC sentence on the task form. - form.js.template: the $http shim's rejection now also carries httpStatus/ errorMessage at the top level (ApiError's shape), alongside the legacy data.message field kept for .form code authored against the old shim. - FormIntentGenerator: the generated COMPLETE catch now calls App.services.apiErrors.refusalMessageFor(error, 'Submit failed.') instead of reading error.data.message. - template-bpm's trigger-new-process.form.template scaffold had the identical error.data.message pattern in its own alert() - same code shape, same fix. - IntentEmissionCoverageIT's generated-page walk now also flags `error.data.message`, the third spelling of the raw-message defect (neither of the existing two patterns matched it, which is why the walk missed this surface in the first place). - Added TaskFormApiErrorTest (mirrors FormCancelActionTest): no `forms:`/ userTask form binding exists in IntentEmissionCoverageIT's giant fixture to exercise gen/.../forms/*/form.js, so FormIntentGenerator's fix is unit-tested directly against its generated `code` field instead of growing that fixture. Verified: mvn formatter:validate (repo-wide, BUILD SUCCESS); TaskFormApiErrorTest and FormCancelActionTest green; IntentEmissionCoverageIT green. Not run: the Selenide BPMStarterTemplateIT that exercises the template-bpm scaffold end to end - the touched line is the failure-path alert() text only, the success path the test asserts on is unchanged, and the JSON/JS is valid by inspection. Fixes eclipse-dirigible#7296 Co-Authored-By: Claude Sonnet 5 <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
#7271/#7263routed the admin page, the my/partner list and calendar loads, the report page and the genericsubmit()throughapiErrors.refusalMessageFor— but not the path every process user task actually takes.FormIntentGenerator's generated COMPLETE catch readerror.data.message, and the$httpcompat shim intemplate-form-builder-harmonia'sform.js.templatecollapsed a caught error into{ data: { message: e.message } }before that, discardinghttpStatus/errorMessageentirely — so a 500 fromPOST /services/inbox/tasks/{id}(a repository throwing inside a check gate, a constraint the 409 mapper does not know) printed the raw Hibernate/JDBC sentence on the task form.form.js.template: the$httpshim's rejection now also carrieshttpStatus/errorMessageat the top level (ApiError's shape), alongside the legacydata.messagefield kept for.formcode authored against the old shim.FormIntentGenerator: the generated COMPLETE catch now callsApp.services.apiErrors.refusalMessageFor(error, 'Submit failed.')instead of readingerror.data.message.template-bpm'strigger-new-process.form.templatescaffold had the identicalerror.data.messagepattern in its ownalert()— same code shape, same fix (grepped sibling templates per the repo's own convention).IntentEmissionCoverageIT's generated-page walk now also flagserror.data.message, the third spelling of the raw-message defect (neither of the existing two patterns matched it, which is why the walk missed this surface in the first place).TaskFormApiErrorTest(mirrors the existingFormCancelActionTest): noforms:/userTaskform binding exists inIntentEmissionCoverageIT's giant fixture to exercisegen/.../forms/*/form.js, soFormIntentGenerator's fix is unit-tested directly against its generatedcodefield instead of growing that fixture.Test plan
mvn formatter:validate(repo-wide) —BUILD SUCCESSTaskFormApiErrorTest+FormCancelActionTest(unit,engine-intent) — greenmvn -pl tests/tests-integrations -am -P integration-tests -Dit.test=IntentEmissionCoverageIT -D selenide.headless=true install— greenBPMStarterTemplateITthat exercises thetemplate-bpmscaffold end to end — the touched line is the failure-pathalert()text only, the success path the test asserts on is unchanged, and the JSON/JS is valid by inspectionFixes #7296
🤖 Generated with Claude Code