Skip to content

Give context in no-widget-for-type exception #4731

@quazgar

Description

@quazgar

Prerequisites

What theme are you using?

core

Is your feature request related to a problem? Please describe.

When no widget for a given specification can be found, the error message does not mention where the error occurs, although the context is available to the code.

Example playground link: Array with "ui:widget": "radio"

Describe the solution you'd like

The error should mention where in the schema the problem occurs.

The call stack for specific error looks like this:

getWidget(): getWidget.js: 114
renderCustomWidget(): ArrayField.js: 444
render(): ArrayField.js: 369

In render() in ArrayField.js, all the necessary information for a more meaningful Error message is available: schema and idSchema give the context which developers can use to pinpoint the problem (an invalid widget specification in this case).

Describe alternatives you've considered

Setting a breakpoint at getWidget.js:114 can also be used, but only if the problem is reproducible for developers. Users reporting the error typically don't have this possibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIs a feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions