Skip to content

[Resource][Docs] Document how a processor prevents an operation with an error flash - #397

Open
SVillette wants to merge 1 commit into
Sylius:mainfrom
SVillette:docs-resource-write-exception-flash
Open

SVillette wants to merge 1 commit into
Sylius:mainfrom
SVillette:docs-resource-write-exception-flash

Conversation

@SVillette

Copy link
Copy Markdown

The resource docs do not explain how a processor can refuse to write data and display an error to the user.

This adds an "Example #3: Prevent an operation and display an error" section to docs/resource/processors.md:

  • a delete processor throwing a WriteResourceException (an accepted subscription cannot be deleted);
  • the order in which the error flash translation key is looked up in the flashes domain, and the %resource% parameter;
  • a warning that the first constructor argument of WriteResourceException is the resource name, so the key goes in the named message argument.

The first lookup step (the message of the exception) depends on Sylius/SyliusResourceBundle#1172, which targets 1.15 — this PR should be merged after it. Without it, the rest of the section already describes the current behaviour.

🤖 Generated with Claude Code

…n error flash

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant