Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Log exceptions that happen on unknown exception and return generic er…
…ror messages

Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Jun 29, 2021
commit 6ea959f10039b5b1a79ca5e68eb0a5926f7ae257
7 changes: 4 additions & 3 deletions lib/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public function create($fileId = null, $filePath = null, $token = null, $guestNa

$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);
Expand Down Expand Up @@ -187,9 +188,9 @@ public function sync($documentId, $sessionId, $sessionToken, $version = 0, $auto
} 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);
}

Expand Down