From 2a38605545e26ce68a37e5ebb877fd9c9875a37d Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 17 Jan 2018 15:21:56 +0100 Subject: Properly log the full exception instead of only the message Signed-off-by: Morris Jobke --- apps/sharebymail/lib/ShareByMailProvider.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'apps/sharebymail') diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index f610a1a5fa9..287c6abff59 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -351,11 +351,19 @@ class ShareByMailProvider implements IShareProvider { $share->getExpirationDate() ); } catch (HintException $hintException) { - $this->logger->error('Failed to send share by mail: ' . $hintException->getMessage()); + $this->logger->logException($hintException, [ + 'message' => 'Failed to send share by mail.', + 'level' => \OCP\Util::ERROR, + 'app' => 'sharebymail', + ]); $this->removeShareFromTable($shareId); throw $hintException; } catch (\Exception $e) { - $this->logger->error('Failed to send share by email: ' . $e->getMessage()); + $this->logger->logException($e, [ + 'message' => 'Failed to send share by mail.', + 'level' => \OCP\Util::ERROR, + 'app' => 'sharebymail', + ]); $this->removeShareFromTable($shareId); throw new HintException('Failed to send share by mail', $this->l->t('Failed to send share by email')); -- cgit v1.2.3