Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable19] Log exceptions that happen on unknown exception and return generic messages #1699

Merged
merged 1 commit into from
Jun 29, 2021
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
7 changes: 4 additions & 3 deletions lib/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,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 @@ -194,9 +195,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