From facd1d3481f048ee7cab9fef31a6f2d50deb1c4f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 18 Feb 2019 11:41:27 +0100 Subject: [PATCH] Less alerting log entries on fails Signed-off-by: Joas Schilling --- lib/Push.php | 1 + tests/Unit/PushTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/Push.php b/lib/Push.php index beade4755..04e45d5d9 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -146,6 +146,7 @@ public function pushToDevice(int $id, INotification $notification) { } catch (\Exception $e) { $this->log->logException($e, [ 'app' => 'notifications', + 'level' => $e->getCode() === Http::STATUS_BAD_REQUEST ? ILogger::INFO : ILogger::WARN, ]); continue; } diff --git a/tests/Unit/PushTest.php b/tests/Unit/PushTest.php index 4b4862a94..00bb68a47 100644 --- a/tests/Unit/PushTest.php +++ b/tests/Unit/PushTest.php @@ -435,6 +435,7 @@ public function testPushToDeviceSending($isDebug) { ->method('logException') ->with($e, [ 'app' => 'notifications', + 'level' => ILogger::WARN, ]); /** @var IResponse|\PHPUnit_Framework_MockObject_MockObject $response1 */