From 0ddb9c01362a74662a4f062683c82c1594c7da01 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Fri, 20 Dec 2019 11:09:05 +0100 Subject: Expose exception message in the response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files/lib/Controller/DirectEditingController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/files/lib/Controller/DirectEditingController.php b/apps/files/lib/Controller/DirectEditingController.php index b19d0f3ea1d..099c65f73e6 100644 --- a/apps/files/lib/Controller/DirectEditingController.php +++ b/apps/files/lib/Controller/DirectEditingController.php @@ -89,7 +89,7 @@ class DirectEditingController extends OCSController { ]); } catch (Exception $e) { $this->logger->logException($e, ['message' => 'Exception when creating a new file through direct editing']); - return new DataResponse('Failed to create file', Http::STATUS_FORBIDDEN); + return new DataResponse('Failed to create file: ' . $e->getMessage(), Http::STATUS_FORBIDDEN); } } @@ -106,7 +106,7 @@ class DirectEditingController extends OCSController { ]); } catch (Exception $e) { $this->logger->logException($e, ['message' => 'Exception when opening a file through direct editing']); - return new DataResponse('Failed to open file', Http::STATUS_FORBIDDEN); + return new DataResponse('Failed to open file: ' . $e->getMessage(), Http::STATUS_FORBIDDEN); } } @@ -122,7 +122,7 @@ class DirectEditingController extends OCSController { return new DataResponse($this->directEditingManager->getTemplates($editorId, $creatorId)); } catch (Exception $e) { $this->logger->logException($e); - return new DataResponse('Failed to open file', Http::STATUS_INTERNAL_SERVER_ERROR); + return new DataResponse('Failed to obtain template list: ' . $e->getMessage(), Http::STATUS_INTERNAL_SERVER_ERROR); } } } -- cgit v1.2.3