Found while investigating form UX during the HotCRM 17.0.0-rc.0 upgrade (tag commit fc156fa4a). Minor but it forecloses per-field error display for any surface served by the runtime dispatcher.
Facts
ValidationError carries .code='VALIDATION_FAILED' and .fields[], but no .status/.statusCode/.issues (packages/objectql/src/validation/record-validator.ts:106-122).@objectstack/rest maps it correctly → 400 with top-level fields[] (packages/rest/src/rest-server.ts:134-143).- The runtime dispatcher's two error exits do neither:
packages/runtime/src/http-dispatcher.ts:495-506 (errorFromThrown): status falls back to 500 (no .status on the error), details reads only .issues (absent) → fields[] lost.packages/runtime/src/dispatcher-plugin.ts:378-410 (errorResponseBase): same status fallback; body carries only {message, code}, and :402 replaces the message with the generic INTERNAL_ERROR_MESSAGE on 5xx — so the caller gets a 500 "internal error" for a user-input validation failure.
Ask
Teach both dispatcher exits the VALIDATION_FAILED shape (status 400 + fields[] passthrough), matching rest-server.
Found while investigating form UX during the HotCRM 17.0.0-rc.0 upgrade (tag commit
fc156fa4a). Minor but it forecloses per-field error display for any surface served by the runtime dispatcher.Facts
ValidationErrorcarries.code='VALIDATION_FAILED'and.fields[], but no.status/.statusCode/.issues(packages/objectql/src/validation/record-validator.ts:106-122).@objectstack/restmaps it correctly → 400 with top-levelfields[](packages/rest/src/rest-server.ts:134-143).packages/runtime/src/http-dispatcher.ts:495-506(errorFromThrown): status falls back to 500 (no.statuson the error),detailsreads only.issues(absent) →fields[]lost.packages/runtime/src/dispatcher-plugin.ts:378-410(errorResponseBase): same status fallback; body carries only{message, code}, and:402replaces the message with the generic INTERNAL_ERROR_MESSAGE on 5xx — so the caller gets a 500 "internal error" for a user-input validation failure.Ask
Teach both dispatcher exits the
VALIDATION_FAILEDshape (status 400 +fields[]passthrough), matching rest-server.