From: Rich Lott / Artful Robot Date: Wed, 5 Jul 2023 15:57:47 +0000 (+0100) Subject: Add debug level log message when afform submissions catch exceptions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ed2077175662d0054494fa37b76c9596f8be9119;p=civicrm-core.git Add debug level log message when afform submissions catch exceptions The code comments suggest we don't really know what to do here, previously we did nothing, which was not helpful to a developer trying to figure out why their code did nothing. Now we emit the exception's message to the log file. --- diff --git a/ext/afform/core/Civi/Api4/Action/Afform/Submit.php b/ext/afform/core/Civi/Api4/Action/Afform/Submit.php index df072b1d7b..d31b29d1a1 100644 --- a/ext/afform/core/Civi/Api4/Action/Afform/Submit.php +++ b/ext/afform/core/Civi/Api4/Action/Afform/Submit.php @@ -331,6 +331,7 @@ class Submit extends AbstractProcessor { catch (\CRM_Core_Exception $e) { // What to do here? Sometimes we should silently ignore errors, e.g. an optional entity // intentionally left blank. Other times it's a real error the user should know about. + \Civi::log()->debug("Silently ignoring exception in Afform processGenericEntity call: " . $e->getMessage()); } } }