From 8889e14c7cb848634895d8bbdedd13194c37301c Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Tue, 29 May 2018 16:21:13 +0200 Subject: implement accept share notification Signed-off-by: Bjoern Schiessle --- .../lib/Controller/RequestHandlerController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'apps/cloud_federation_api/lib/Controller') 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 -- cgit v1.2.3