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.
This commit is contained in:
Tim Dettrick 2015-09-04 11:40:23 +10:00
parent c15ba0d658
commit 1b582ba66b

View file

@ -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;
}
}