Normalize generation error notice messages#562
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #562 +/- ##
==========================================
Coverage 71.21% 71.21%
Complexity 1151 1151
==========================================
Files 67 67
Lines 5565 5565
==========================================
Hits 3963 3963
Misses 1602 1602
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |




What?
This PR normalizes error notice messages in the Excerpt Generation and Content Summarization experiments.
Both features were passing the caught JavaScript
Errorobject directly tocreateErrorNotice(). They now pass a plain message string instead.Why?
WordPress notices already identify these notices as errors. Passing the raw
Errorobject caused the visible notice text to include a redundantError:prefix.For example, the Excerpt Generation notice previously rendered as:
Error: Content is required to generate an excerpt suggestion.After this change, it renders as:
Content is required to generate an excerpt suggestion.This makes the notices cleaner and more consistent with other generation features.
How?
Testing Instructions
Excerpt Generation
Error:prefix.Content Summarization
Error:prefix.Automated Testing
npm run lint:jsnpm run typechecknpx wp-scripts test-playwright --config tests/e2e/playwright.config.ts tests/e2e/specs/experiments/excerpt-generation.spec.js tests/e2e/specs/experiments/content-summarization.spec.js --project=chromiumFocused E2E result:
12 passed.Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT / Codex
Used for: Repository review, implementation guidance, code changes, regression test updates, and local verification. I reviewed the changes, tested the behavior locally, and take responsibility for the final submission.