File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
apps/dav/lib/Connector/Sabre Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -449,14 +449,19 @@ public function get() {
449449 // do a if the file did not exist
450450 throw new NotFound ();
451451 }
452+ $ path = ltrim ($ this ->path , '/ ' );
452453 try {
453- $ res = $ this ->fileView ->fopen (ltrim ( $ this -> path , ' / ' ) , 'rb ' );
454+ $ res = $ this ->fileView ->fopen ($ path , 'rb ' );
454455 } catch (\Exception $ e ) {
455456 $ this ->convertToSabreException ($ e );
456457 }
457458
458459 if ($ res === false ) {
459- throw new ServiceUnavailable ($ this ->l10n ->t ('Could not open file ' ));
460+ if ($ this ->fileView ->file_exists ($ path )) {
461+ throw new ServiceUnavailable ($ this ->l10n ->t ('Could not open file: %1$s, file does seem to exist ' , [$ path ]));
462+ } else {
463+ throw new ServiceUnavailable ($ this ->l10n ->t ('Could not open file: %1$s, file doesn \'t seem to exist ' , [$ path ]));
464+ }
460465 }
461466
462467 // comparing current file size with the one in DB
You can’t perform that action at this time.
0 commit comments