From 9ec359df3dbf25cb736ab041f3dd5ea86197a93d Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 27 Jan 2020 11:21:58 +0200 Subject: [PATCH] app params try catch --- application/Espo/Services/App.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/Espo/Services/App.php b/application/Espo/Services/App.php index 5c3a9b94ed..ce9892dd50 100644 --- a/application/Espo/Services/App.php +++ b/application/Espo/Services/App.php @@ -107,7 +107,12 @@ class App extends \Espo\Core\Services\Base foreach (($this->getMetadata()->get(['app', 'appParams']) ?? []) as $paramKey => $item) { $className = $item['className'] ?? null; if (!$className) continue; - $itemParams = $this->getInjection('injectableFactory')->createByClassName($className)->get(); + try { + $itemParams = $this->getInjection('injectableFactory')->createByClassName($className)->get(); + } catch (\Throwable $e) { + $GLOBALS['log']->error("appParam {$paramKey}: " . $e->getMessage()); + continue; + } $appParams[$paramKey] = $itemParams; }