Catch Throwable instead of Exception will also catch NULL issues
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3331919. --> Reported by: [jurgenhaas](https://www.drupal.org/user/168924) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>In some critical code areas like e.g. <code>\Drupal\eca\Entity\Objects\EcaAction::execute</code> we use 'try/catch' for <code>\Exception</code>. 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 <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/eca/-/work_items/3331855" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/eca/-/work_items/3331855</a></span> as an example.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Catching <code>\Throwable</code> 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.</p> <p>There are other places too like e.g. collecting all available plugins where this would help a lot to avoid issues with incompatible modules.</p>
issue