diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-06-29 18:52:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 18:52:13 +0300 |
commit | 086281fd19d0a9953285df980bd36b5d711ada0f (patch) | |
tree | 6f78a5901a92aa6596cd9461f0cb9ce985fbb44b | |
parent | 639e2a78c98dc89e7c6a065c014e0021f1ba7158 (diff) | |
parent | 6ea959f10039b5b1a79ca5e68eb0a5926f7ae257 (diff) |
Merge pull request #1697 from nextcloud/backport/1695/stable21
[stable21] Log exceptions that happen on unknown exception and return generic messages
-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 5691734ff..faa4c879e 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -95,7 +95,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); @@ -187,9 +188,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); } |