From: Robin Appelman Date: Thu, 25 May 2023 15:03:18 +0000 (+0200) Subject: log failures to read certificates during listing X-Git-Tag: v26.0.3rc1~3^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5fde58d4f0c6bc0dbafaac772d4b0c46fe7e7c9b;p=nextcloud-server.git log failures to read certificates during listing Signed-off-by: Robin Appelman --- diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index 6231534205a..9f824f56bb2 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -92,8 +92,14 @@ class CertificateManager implements ICertificateManager { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') { try { - $result[] = new Certificate($this->view->file_get_contents($path . $file), $file); + $content = $this->view->file_get_contents($path . $file); + if ($content !== false) { + $result[] = new Certificate($content, $file); + } else { + $this->logger->error("Failed to read certificate from $path"); + } } catch (\Exception $e) { + $this->logger->error("Failed to read certificate from $path", ['exception' => $e]); } } }