Skip to content

fix(TRAC-875): preserve ValidationError type in render/renderString - #404

Merged
jairo-bc merged 1 commit into
masterfrom
jairopanduro/trac-875-preserve-validation-error-type
Jul 13, 2026
Merged

fix(TRAC-875): preserve ValidationError type in render/renderString#404
jairo-bc merged 1 commit into
masterfrom
jairopanduro/trac-875-preserve-validation-error-type

Conversation

@jairo-bc

@jairo-bc jairo-bc commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Jira: TRAC-875

What? Why?

  • Helper input-validation errors (e.g. assignVar rejecting values >1024 chars) were wrapped as RenderError, losing the original ValidationError type
  • Downstream consumers need to tell "client/theme input fault" apart from "generic render failure" to map the former to a 4xx instead of 500
  • render()/renderString() now re-throw ValidationError as-is instead of wrapping it
  • No change to helpers or to ValidationError itself

Part of a 3-repo change (paper-handlebars → storefront-renderer-2 → storefront) downgrading these errors from 500 to 4xx.

How was it tested?

  • Added specs asserting a helper ValidationError is rejected as ValidationError (not RenderError) from both render() and renderString()
  • Full suite passes (53/53)

@jairo-bc jairo-bc changed the title TRAC-875: Preserve ValidationError type in render/renderString fix(TRAC-875): preserve ValidationError type in render/renderString Jul 13, 2026
Helper input-validation failures (e.g. assignVar rejecting values over
1024 characters) were wrapped as RenderError, losing the ValidationError
type. Downstream consumers need to distinguish client/theme-input
faults from generic render failures in order to map them to a 4xx
instead of a 500.

Re-thrown ValidationErrors are reformatted to match RenderError's
`${message} : ${stack}` shape, so downstream log parsing keeps working.

Refs TRAC-875
@jairo-bc
jairo-bc force-pushed the jairopanduro/trac-875-preserve-validation-error-type branch from 68e1b41 to a28c25c Compare July 13, 2026 14:48
@jairo-bc
jairo-bc marked this pull request as ready for review July 13, 2026 15:12
@jairo-bc
jairo-bc merged commit e50e87e into master Jul 13, 2026
13 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.6.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants