Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292064

Throw consistent exceptions on invalid process plugin configurations.

$
0
0

Problem/Motivation

Currently the way we handle exceptions on configuration errors is inconsistent in our process plugins. Sometimes an exception is thrown in the constructor, sometimes we throw exceptions for invalid configurations in the constructor, sometimes we don't do it until the transform method is called. There is some inconsistency in which exceptions get thrown as well.

All plugins should do the following:
If the plugin configuration is invalid, and this can be determined from the configuration alone with no value to transform, the plugins should throw a consistent exception in the constructor, specific exception to be determined.

If the configuration is valid, but certain inputs are not, then the plugin should determine this in the transform method and throw a consistant exception there, exception tbd

In most cases, moving or changing the exception will be a breaking change, so we will likely have to add @trigger_errors in all the places we want to put new exceptions warning people that we will be adding the new exceptions in the next major version, Drupal 10 currently if we can get this into Drupal 9.4. We should have a version of the patch ready for D10 as well that actually adds the excpetions.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 292064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>