Skip to content

adds object of useful error when widget fails to render - #5141

Merged
ValJed merged 4 commits into
mainfrom
pro-8196-improve-render-widget-error
Nov 18, 2025
Merged

ValJed merged 4 commits into
mainfrom
pro-8196-improve-render-widget-error

Conversation

@ValJed

@ValJed ValJed commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds an object of useful info when a widget fails to render:

widgetTitle
widgetType
documentId
errors

Error will list fields that failed.

What are the specific steps to test this change?

Check error when widget fails to render.

What kind of change does this PR introduce?

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

@linear

linear Bot commented Nov 5, 2025

Copy link
Copy Markdown

@ValJed
ValJed requested review from boutell and haroun November 11, 2025 13:44
Comment thread modules/@apostrophecms/widget-type/ui/apos/composables/AposWidget.js Outdated
@ValJed
ValJed requested a review from haroun November 13, 2025 15:42
@ValJed
ValJed force-pushed the pro-8196-improve-render-widget-error branch from dbaec91 to 0e8fe9b Compare November 13, 2025 16:33
widgetTitle: widget.title,
widgetType: props.type,
documentId: props.docId,
errors: e.body.data?.errors || []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed it the first time. I don't think we can be absolutely sure that e.body will be an object. I'll do e.body?.data?.errors instead

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done.

@ValJed
ValJed requested review from haroun and removed request for boutell November 18, 2025 08:54
widgetTitle: widget.title,
widgetType: props.type,
documentId: props.docId,
errors: e.body.data?.errors || []

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could name it fieldErrors maybe ?

widgetTitle: widget.title,
widgetType: props.type,
documentId: props.docId,
errors: e.body.data?.errors || []

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done.

@ValJed
ValJed merged commit 10ac55e into main Nov 18, 2025
12 checks passed
@ValJed
ValJed deleted the pro-8196-improve-render-widget-error branch November 18, 2025 15:07
haroun added a commit that referenced this pull request Nov 19, 2025
* main:
  PRO-8708: bring back passing of the actual area options in the form developers expect to see them to custom insert menu item components (#5162)
  adds object of useful error when widget fails to render (#5141)
  add addMissingSchemaFields task (#5101)
  Pro 8360 box field (#5142)
  Pro 8671 fix localize modal (#5156)
  longPolling: false option (#5154)
  PRO-5472: file widget (#5126)
haroun added a commit that referenced this pull request Nov 19, 2025
* main:
  PRO-8708: bring back passing of the actual area options in the form developers expect to see them to custom insert menu item components (#5162)
  adds object of useful error when widget fails to render (#5141)
  add addMissingSchemaFields task (#5101)
  Pro 8360 box field (#5142)
  Pro 8671 fix localize modal (#5156)
  longPolling: false option (#5154)
  PRO-5472: file widget (#5126)
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.

3 participants