newsletter emailing

Stay on top with regular WordPress updates.

Subscribe to our newsletter(s) and get the latest stories in your mailbox!

greengeeks

Support for handling resolution errors for Editor data module

Date:

WordPress 6.0 no longer ignores the exceptions thrown by the resolvers.

In WordPress 5.9 and earlier, an exception thrown inside the resolver kept it in the resolving state forever. It never got marked as finished. In WordPress 6.0, the resolver state is set to error and the exception is re-thrown. This backwards compatibility-breaking change affects both resolvers from newly registered stores and the resolvers from the WordPress stores, e.g. the getEntityRecord resolver from the core store.

Example:

Let’s register an example store where the resolver always throws an error:

const temperatureStore = wp.data.createReduxStore( ‘my-store’, { selectors: { getTemperature: ( state

This is the first part of the article

Support for handling resolution errors for Editor data module

seopressbig