diff options
-rw-r--r-- | lib/Service/RecordingService.php | 5 | ||||
-rw-r--r-- | tests/php/Service/RecordingServiceTest.php | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/Service/RecordingService.php b/lib/Service/RecordingService.php index 0a7f7af2a..7a26c4ebb 100644 --- a/lib/Service/RecordingService.php +++ b/lib/Service/RecordingService.php @@ -43,6 +43,7 @@ use OCP\Files\NotPermittedException; use OCP\Notification\IManager; use OCP\Share\IManager as ShareManager; use OCP\Share\IShare; +use Psr\Log\LoggerInterface; class RecordingService { public const DEFAULT_ALLOWED_RECORDING_FORMATS = [ @@ -61,7 +62,8 @@ class RecordingService { protected Config $config, protected RoomService $roomService, protected ShareManager $shareManager, - protected ChatManager $chatManager + protected ChatManager $chatManager, + protected LoggerInterface $logger, ) { } @@ -236,6 +238,7 @@ class RecordingService { true ); } catch (\Exception $e) { + $this->logger->error($e->getMessage(), ['exception' => $e]); throw new InvalidArgumentException('system'); } $this->notificationDismiss($room, $participant, $timestamp); diff --git a/tests/php/Service/RecordingServiceTest.php b/tests/php/Service/RecordingServiceTest.php index f99ac5c12..998e012b1 100644 --- a/tests/php/Service/RecordingServiceTest.php +++ b/tests/php/Service/RecordingServiceTest.php @@ -47,6 +47,7 @@ use OCP\Files\IRootFolder; use OCP\Notification\IManager; use OCP\Share\IManager as ShareManager; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Test\TestCase; class RecordingServiceTest extends TestCase { @@ -70,6 +71,8 @@ class RecordingServiceTest extends TestCase { private $shareManager; /** @var ChatManager|MockObject */ private $chatManager; + /** @var LoggerInterface|MockObject */ + private $logger; /** @var RecordingService */ protected $recordingService; @@ -86,6 +89,7 @@ class RecordingServiceTest extends TestCase { $this->roomService = $this->createMock(RoomService::class); $this->shareManager = $this->createMock(ShareManager::class); $this->chatManager = $this->createMock(ChatManager::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->recordingService = new RecordingService( $this->mimeTypeDetector, @@ -97,7 +101,8 @@ class RecordingServiceTest extends TestCase { $this->config, $this->roomService, $this->shareManager, - $this->chatManager + $this->chatManager, + $this->logger, ); } |