-
Notifications
You must be signed in to change notification settings - Fork 652
adds object of useful error when widget fails to render #5141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,8 +80,15 @@ export async function _renderContent(props) { | |
| } | ||
| return {}; | ||
| } catch (e) { | ||
| const errData = { | ||
| widgetTitle: widget.title, | ||
| widgetType: props.type, | ||
| documentId: props.docId, | ||
| errors: e.body.data?.errors || [] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, done. |
||
| }; | ||
|
|
||
| // eslint-disable-next-line no-console | ||
| console.error('Unable to render widget. Possibly the schema has been changed and the existing widget does not pass validation.', e); | ||
| console.error('Unable to render widget', errData, e); | ||
| return { | ||
| data: '<p>Unable to render this widget.</p>', | ||
| error: true | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could name it
fieldErrorsmaybe ?