From aed6cc223c1574bf424b666d4ba8a3bcf65086c5 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 14 Jun 2018 00:53:59 -0700 Subject: [PATCH] (dev/core#178) Redis - Be a little more conservative about sharing error info --- CRM/Utils/Cache/Redis.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Cache/Redis.php b/CRM/Utils/Cache/Redis.php index 768588f606..4c6259a7fd 100644 --- a/CRM/Utils/Cache/Redis.php +++ b/CRM/Utils/Cache/Redis.php @@ -117,7 +117,13 @@ class CRM_Utils_Cache_Redis implements CRM_Utils_Cache_Interface { */ public function set($key, &$value) { if (!$this->_cache->set($this->_prefix . $key, serialize($value), $this->_timeout)) { - CRM_Core_Error::fatal("Redis set ($key) failed: " . $this->_cache->getLastError(), $value); + if (PHP_SAPI === 'cli' || (Civi\Core\Container::isContainerBooted() && CRM_Core_Permission::check('view debug output'))) { + CRM_Core_Error::fatal("Redis set ($key) failed: " . $this->_cache->getLastError()); + } + else { + Civi::log()->error("Redis set ($key) failed: " . $this->_cache->getLastError()); + CRM_Core_Error::fatal("Redis set ($key) failed"); + } return FALSE; } return TRUE; -- 2.25.1