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 @@ -458,14 +458,19 @@ public function get() {
458458 // do a if the file did not exist
459459 throw new NotFound ();
460460 }
461+ $ path = ltrim ($ this ->path , '/ ' );
461462 try {
462- $ res = $ this ->fileView ->fopen (ltrim ( $ this -> path , ' / ' ) , 'rb ' );
463+ $ res = $ this ->fileView ->fopen ($ path , 'rb ' );
463464 } catch (\Exception $ e ) {
464465 $ this ->convertToSabreException ($ e );
465466 }
466467
467468 if ($ res === false ) {
468- throw new ServiceUnavailable ($ this ->l10n ->t ('Could not open file ' ));
469+ if ($ this ->fileView ->file_exists ($ path )) {
470+ throw new ServiceUnavailable ($ this ->l10n ->t ('Could not open file: %1$s, file does seem to exist ' , [$ path ]));
471+ } else {
472+ throw new ServiceUnavailable ($ this ->l10n ->t ('Could not open file: %1$s, file doesn \'t seem to exist ' , [$ path ]));
473+ }
469474 }
470475
471476 // comparing current file size with the one in DB
You can’t perform that action at this time.
0 commit comments