@@ -459,7 +459,10 @@ public function userUploadsAFileTo($user, $source, $destination) {
459459 try {
460460 $ this ->response = $ this ->makeDavRequest ($ user , "PUT " , $ destination , [], $ file );
461461 } catch (\GuzzleHttp \Exception \ServerException $ e ) {
462- // 4xx and 5xx responses cause an exception
462+ // 5xx responses cause a server exception
463+ $ this ->response = $ e ->getResponse ();
464+ } catch (\GuzzleHttp \Exception \ClientException $ e ) {
465+ // 4xx responses cause a client exception
463466 $ this ->response = $ e ->getResponse ();
464467 }
465468 }
@@ -488,7 +491,10 @@ public function userUploadsAFileWithContentTo($user, $content, $destination) {
488491 try {
489492 $ this ->response = $ this ->makeDavRequest ($ user , "PUT " , $ destination , [], $ file );
490493 } catch (\GuzzleHttp \Exception \ServerException $ e ) {
491- // 4xx and 5xx responses cause an exception
494+ // 5xx responses cause a server exception
495+ $ this ->response = $ e ->getResponse ();
496+ } catch (\GuzzleHttp \Exception \ClientException $ e ) {
497+ // 4xx responses cause a client exception
492498 $ this ->response = $ e ->getResponse ();
493499 }
494500 }
@@ -503,7 +509,10 @@ public function userDeletesFile($user, $type, $file) {
503509 try {
504510 $ this ->response = $ this ->makeDavRequest ($ user , 'DELETE ' , $ file , []);
505511 } catch (\GuzzleHttp \Exception \ServerException $ e ) {
506- // 4xx and 5xx responses cause an exception
512+ // 5xx responses cause a server exception
513+ $ this ->response = $ e ->getResponse ();
514+ } catch (\GuzzleHttp \Exception \ClientException $ e ) {
515+ // 4xx responses cause a client exception
507516 $ this ->response = $ e ->getResponse ();
508517 }
509518 }
@@ -518,7 +527,10 @@ public function userCreatedAFolder($user, $destination) {
518527 $ destination = '/ ' . ltrim ($ destination , '/ ' );
519528 $ this ->response = $ this ->makeDavRequest ($ user , "MKCOL " , $ destination , []);
520529 } catch (\GuzzleHttp \Exception \ServerException $ e ) {
521- // 4xx and 5xx responses cause an exception
530+ // 5xx responses cause a server exception
531+ $ this ->response = $ e ->getResponse ();
532+ } catch (\GuzzleHttp \Exception \ClientException $ e ) {
533+ // 4xx responses cause a client exception
522534 $ this ->response = $ e ->getResponse ();
523535 }
524536 }
@@ -589,8 +601,12 @@ public function userMovesNewChunkFileWithIdToMychunkedfileWithSize($user, $id, $
589601 public function downloadingFileAs ($ fileName , $ user ) {
590602 try {
591603 $ this ->response = $ this ->makeDavRequest ($ user , 'GET ' , $ fileName , []);
592- } catch (\GuzzleHttp \Exception \ServerException $ ex ) {
593- $ this ->response = $ ex ->getResponse ();
604+ } catch (\GuzzleHttp \Exception \ServerException $ e ) {
605+ // 5xx responses cause a server exception
606+ $ this ->response = $ e ->getResponse ();
607+ } catch (\GuzzleHttp \Exception \ClientException $ e ) {
608+ // 4xx responses cause a client exception
609+ $ this ->response = $ e ->getResponse ();
594610 }
595611 }
596612
0 commit comments