From ed2077175662d0054494fa37b76c9596f8be9119 Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot Date: Wed, 5 Jul 2023 16:57:47 +0100 Subject: [PATCH] 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. --- ext/afform/core/Civi/Api4/Action/Afform/Submit.php | 1 + 1 file changed, 1 insertion(+) 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()); } } } -- 2.25.1