[BUGFIX] FileNotFound exception caught too early 29/19229/4
authorAndreas Wolf <andreas.wolf@typo3.org>
Sat, 23 Mar 2013 16:07:03 +0000 (17:07 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sun, 24 Mar 2013 13:20:27 +0000 (14:20 +0100)
Change-Id: Iae9bb0c9a20947f39cad96582f76a7ae1cccf0c5
Related: #46629
Reviewed-on: https://review.typo3.org/19229
Reviewed-by: Andreas Wolf
Tested-by: Andreas Wolf
Classes/Driver/WebDavDriver.php

index cb9b5b7..87d3d3c 100644 (file)
@@ -187,10 +187,14 @@ class WebDavDriver extends \TYPO3\CMS\Core\Resource\Driver\AbstractDriver {
        protected function executeDavRequest($method, $url, $body = NULL, array $headers = array()) {
                try {
                        return $this->davClient->request($method, $url, $body, $headers);
-               } catch (\Exception $exception) {
+               } catch (\Sabre_DAV_Exception_NotFound $exception) {
+                       // If a file is not found, we have to deal with that on a higher level, so throw the exception again
+                       throw $exception;
+               } catch (\Sabre_DAV_Exception $exception) {
+                       // log all other exceptions
                        $this->logger->error(sprintf(
-                               'Error while executing DAV request. Original message: "%s" (Exception id: %u)',
-                               $exception->getMessage(), $exception->getCode()
+                               'Error while executing DAV request. Original message: "%s" (Exception %s, id: %u)',
+                               $exception->getMessage(), get_class($exception), $exception->getCode()
                        ));
                        $this->storage->markAsTemporaryOffline();
                        return array();