Catch Throwable instead of Exception will also catch NULL issues

Created on 9 January 2023, almost 2 years ago
Updated 19 May 2024, 6 months ago

Problem/Motivation

In some critical code areas like e.g. \Drupal\eca\Entity\Objects\EcaAction::execute we use 'try/catch' for \Exception. This will still fail with a WSOD if an access check or execution of an action wants to do something on a NULL object. See 💬 Smart Date - "Set field value" AssertionError Fixed as an example.

Proposed resolution

Catching \Throwable instead will also catch these issues and provide a much safer experience, especially while building models where it is happing a lot, that e.g. wrong field names get used in ECA configuration.

There are other places too like e.g. collecting all available plugins where this would help a lot to avoid issues with incompatible modules.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany jurgenhaas Gottmadingen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024