diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-05-29 16:21:13 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-02 11:29:28 +0200 |
commit | 8889e14c7cb848634895d8bbdedd13194c37301c (patch) | |
tree | 75f54fd99948e7b3d92ba3028dcdf29477b6630c /apps/cloud_federation_api/lib/Controller | |
parent | bbce8c3ea1c73726f233961fe7bdb16b8a08bb67 (diff) | |
download | nextcloud-server-8889e14c7cb848634895d8bbdedd13194c37301c.tar.gz nextcloud-server-8889e14c7cb848634895d8bbdedd13194c37301c.zip |
implement accept share notification
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/cloud_federation_api/lib/Controller')
-rw-r--r-- | apps/cloud_federation_api/lib/Controller/RequestHandlerController.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php index 5ec1496ce6b..4ee8344b6b5 100644 --- a/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php +++ b/apps/cloud_federation_api/lib/Controller/RequestHandlerController.php @@ -28,6 +28,8 @@ use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\Federation\Exceptions\ActionNotSupportedException; +use OCP\Federation\Exceptions\AuthenticationFailedException; +use OCP\Federation\Exceptions\BadRequestException; use OCP\Federation\Exceptions\ProviderCouldNotAddShareException; use OCP\Federation\Exceptions\ShareNotFoundException; use OCP\Federation\ICloudFederationFactory; @@ -241,7 +243,12 @@ class RequestHandlerController extends Controller { ['message' => $e->getMessage()], Http::STATUS_NOT_IMPLEMENTED ); - } catch (\Exception $e) { + } catch (BadRequestException $e) { + return new JSONResponse($e->getReturnMessage(), Http::STATUS_BAD_REQUEST); + } catch (AuthenticationFailedException $e) { + return new JSONResponse(["message" => "RESOURCE_NOT_FOUND"], Http::STATUS_FORBIDDEN); + } + catch (\Exception $e) { return new JSONResponse( ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], Http::STATUS_BAD_REQUEST |