From 1b582ba66b74c7b5ade4560e8af234d1005089d6 Mon Sep 17 00:00:00 2001 From: Tim Dettrick Date: Fri, 4 Sep 2015 11:40:23 +1000 Subject: [PATCH] Don't log expected Swift 404 responses File existence checks are expected in some cases to be false, so passing 404 Not Found errors through to the logs just causes noise. --- apps/files_external/lib/swift.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index 6f93f3c84c..2e286965a2 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -105,7 +105,10 @@ class Swift extends \OC\Files\Storage\Common { $this->getContainer()->getPartialObject($path); return true; } catch (ClientErrorResponseException $e) { - \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + // Expected response is "404 Not Found", so only log if it isn't + if ($e->getResponse()->getStatusCode() !== 404) { + \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); + } return false; } }