diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-06-29 18:46:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 18:46:15 +0300 |
commit | 794f7f4bfc64d43ca8f04ef0a1eac5a1b3d539e9 (patch) | |
tree | 5cf30eed43049b5f882a283830ea833dd8a60baa /lib/Service/ApiService.php | |
parent | b0a082fd2549daec7ee6c9d342789e9530d6b44d (diff) | |
parent | c617f89d00809d26a54dee5a30946da48fd20e03 (diff) |
Merge pull request #1699 from nextcloud/backport/1695/stable19v19.0.13
[stable19] Log exceptions that happen on unknown exception and return generic messages
Diffstat (limited to 'lib/Service/ApiService.php')
-rw-r--r-- | lib/Service/ApiService.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 4244127e2..12fd1cb6c 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -99,7 +99,8 @@ class ApiService { $document = $this->documentService->createDocument($file); } catch (Exception $e) { - return new DataResponse($e->getMessage(), 500); + $this->logger->logException($e); + return new DataResponse('Failed to create the document session', 500); } $session = $this->sessionService->initSession($document->getId(), $guestName); @@ -194,9 +195,9 @@ class ApiService { } catch (NotFoundException $e) { return new DataResponse([], 404); } catch (Exception $e) { - $this->logger->logException($e, ['level' => ILogger::INFO]); + $this->logger->logException($e); return new DataResponse([ - 'message' => $e->getMessage() + 'message' => 'Failed to autosave document' ], 500); } |