diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-06-07 14:40:12 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-02 11:29:29 +0200 |
commit | 957b27f28267fd95bec9c8a041ca1e7be9d32aa6 (patch) | |
tree | 3b246af7f382572f53624e7afe32bd237da01a09 /apps/federatedfilesharing/lib/Controller | |
parent | 61485e3e600d5a9359ac215602c4778f00d38823 (diff) | |
download | nextcloud-server-957b27f28267fd95bec9c8a041ca1e7be9d32aa6.tar.gz nextcloud-server-957b27f28267fd95bec9c8a041ca1e7be9d32aa6.zip |
replace \OCP\Federation\Exception\ShareNotFoundException with the generic \OCP\Share\Exception\ShareNotFound exception
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/federatedfilesharing/lib/Controller')
-rw-r--r-- | apps/federatedfilesharing/lib/Controller/RequestHandlerController.php | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php index 653c41c3ba0..eb434c30c91 100644 --- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php +++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php @@ -29,7 +29,6 @@ namespace OCA\FederatedFileSharing\Controller; -use OCA\Files_Sharing\Activity\Providers\RemoteShares; use OCA\FederatedFileSharing\AddressHandler; use OCA\FederatedFileSharing\FederatedShareProvider; use OCA\FederatedFileSharing\Notifications; @@ -37,24 +36,19 @@ use OCP\AppFramework\Http; use OCP\AppFramework\OCS\OCSBadRequestException; use OCP\AppFramework\OCS\OCSException; use OCP\AppFramework\OCS\OCSForbiddenException; -use OCP\AppFramework\OCS\OCSNotFoundException; use OCP\AppFramework\OCSController; use OCP\Constants; -use OCP\Federation\Exceptions\AuthenticationFailedException; -use OCP\Federation\Exceptions\BadRequestException; use OCP\Federation\Exceptions\ProviderCouldNotAddShareException; use OCP\Federation\Exceptions\ProviderDoesNotExistsException; -use OCP\Federation\Exceptions\ShareNotFoundException; use OCP\Federation\ICloudFederationFactory; use OCP\Federation\ICloudFederationProviderManager; use OCP\Federation\ICloudIdManager; -use OCP\Files\NotFoundException; use OCP\IDBConnection; use OCP\ILogger; use OCP\IRequest; use OCP\IUserManager; use OCP\Share; -use OCP\Share\IShare; +use OCP\Share\Exceptions\ShareNotFound; class RequestHandlerController extends OCSController { @@ -201,8 +195,8 @@ class RequestHandlerController extends OCSController { * @param int $id * @return Http\DataResponse * @throws OCSBadRequestException + * @throws OCSException * @throws OCSForbiddenException - * @throws OCSNotFoundException */ public function reShare($id) { @@ -236,11 +230,8 @@ class RequestHandlerController extends OCSController { ]); } catch (ProviderDoesNotExistsException $e) { throw new OCSException('Server does not support federated cloud sharing', 503); - } catch (ShareNotFoundException $e) { + } catch (ShareNotFound $e) { $this->logger->debug('Share not found: ' . $e->getMessage()); - } catch (ProviderCouldNotAddShareException $e) { - $this->logger->debug('Could not add reshare: ' . $e->getMessage()); - throw new OCSForbiddenException(); } catch (\Exception $e) { $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); } @@ -258,7 +249,7 @@ class RequestHandlerController extends OCSController { * @param int $id * @return Http\DataResponse * @throws OCSException - * @throws Share\Exceptions\ShareNotFound + * @throws ShareNotFound * @throws \OC\HintException */ public function acceptShare($id) { @@ -275,7 +266,7 @@ class RequestHandlerController extends OCSController { $provider->notificationReceived('SHARE_ACCEPTED', $id, $notification); } catch (ProviderDoesNotExistsException $e) { throw new OCSException('Server does not support federated cloud sharing', 503); - } catch (ShareNotFoundException $e) { + } catch (ShareNotFound $e) { $this->logger->debug('Share not found: ' . $e->getMessage()); } catch (\Exception $e) { $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); @@ -308,7 +299,7 @@ class RequestHandlerController extends OCSController { $provider->notificationReceived('SHARE_DECLINED', $id, $notification); } catch (ProviderDoesNotExistsException $e) { throw new OCSException('Server does not support federated cloud sharing', 503); - } catch (ShareNotFoundException $e) { + } catch (ShareNotFound $e) { $this->logger->debug('Share not found: ' . $e->getMessage()); } catch (\Exception $e) { $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |