From fd5465d509cb74170761d14896a4117f721caafd Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 13 Oct 2017 12:22:20 +0200 Subject: [PATCH 1/2] Fix class name, regression from 44cf67accdc294f46bf82b3f8661f353dc5e22f0 Signed-off-by: Joas Schilling --- apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php index ca2195fc65..677473e497 100644 --- a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php @@ -48,7 +48,7 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin { 'Sabre\DAV\Exception\Forbidden' => true, // Happens when an external storage or federated share is temporarily // not available - 'Sabre\DAV\Exception\StorageNotAvailableException' => true, + 'OCP\Files\StorageNotAvailableException' => true, ]; /** @var string */ From 7c53f921a9e789dcd932a13122f7144239cd0eb3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 13 Oct 2017 12:23:00 +0200 Subject: [PATCH 2/2] Use ::class to avoid errors Signed-off-by: Joas Schilling --- .../Connector/Sabre/ExceptionLoggerPlugin.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php index 677473e497..ba7ea13c54 100644 --- a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php +++ b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php @@ -27,28 +27,34 @@ namespace OCA\DAV\Connector\Sabre; +use OCA\DAV\Connector\Sabre\Exception\PasswordLoginForbidden; +use OCP\Files\StorageNotAvailableException; use OCP\ILogger; +use Sabre\DAV\Exception\Forbidden; +use Sabre\DAV\Exception\NotAuthenticated; +use Sabre\DAV\Exception\NotFound; +use Sabre\DAV\Exception\PreconditionFailed; use Sabre\DAV\Exception\ServiceUnavailable; class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin { protected $nonFatalExceptions = [ - 'Sabre\DAV\Exception\NotAuthenticated' => true, + NotAuthenticated::class => true, // If tokenauth can throw this exception (which is basically as // NotAuthenticated. So not fatal. - 'OCA\DAV\Connector\Sabre\Exception\PasswordLoginForbidden' => true, + PasswordLoginForbidden::class => 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, + NotFound::class => 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, + PreconditionFailed::class => true, // forbidden can be expected when trying to upload to // read-only folders for example - 'Sabre\DAV\Exception\Forbidden' => true, + Forbidden::class => true, // Happens when an external storage or federated share is temporarily // not available - 'OCP\Files\StorageNotAvailableException' => true, + StorageNotAvailableException::class => true, ]; /** @var string */