diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-05-05 11:31:25 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-05-07 11:43:50 +0200 |
commit | 4a493c8835b606e9c2b74f275cb8c471adb5fa06 (patch) | |
tree | 30bf05b2bed64201937828826ad4f24739d1c922 /lib/private | |
parent | 341fcdc37a74b630ef7d47b5f0b336622c072ddc (diff) | |
download | nextcloud-server-4a493c8835b606e9c2b74f275cb8c471adb5fa06.tar.gz nextcloud-server-4a493c8835b606e9c2b74f275cb8c471adb5fa06.zip |
Some expected Sabre exceptions are now logged with DEBUG level
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/connector/sabre/exceptionloggerplugin.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/exceptionloggerplugin.php b/lib/private/connector/sabre/exceptionloggerplugin.php index 8e77afaf207..5eaf1e87621 100644 --- a/lib/private/connector/sabre/exceptionloggerplugin.php +++ b/lib/private/connector/sabre/exceptionloggerplugin.php @@ -11,6 +11,17 @@ class OC_Connector_Sabre_ExceptionLoggerPlugin extends Sabre_DAV_ServerPlugin { + private $nonFatalExceptions = array( + 'Sabre_DAV_Exception_NotAuthenticated' => true, + // the sync client uses this to find out whether files exist, + // so it is not always an error, log it as debug + 'Sabre_DAV_Exception_NotFound' => true, + // this one mostly happens when the same file is uploaded at + // exactly the same time from two clients, only one client + // wins, the second one gets "Precondition failed" + 'Sabre_DAV_Exception_PreconditionFailed' => true, + ); + private $appName; /** @@ -43,8 +54,10 @@ class OC_Connector_Sabre_ExceptionLoggerPlugin extends Sabre_DAV_ServerPlugin */ public function logException($e) { $exceptionClass = get_class($e); - if ($exceptionClass !== 'Sabre_DAV_Exception_NotAuthenticated') { - \OCP\Util::logException($this->appName, $e); + $level = \OCP\Util::FATAL; + if (isset($this->nonFatalExceptions[$exceptionClass])) { + $level = \OCP\Util::DEBUG; } + \OCP\Util::logException($this->appName, $e, $level); } } |