From c56859581794ec38b5c2bca44a0eeef2fc648dc4 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Mon, 1 Nov 2021 14:46:55 +0100 Subject: [PATCH] Video compression error logging: code style --- .../sdk/internal/session/content/UploadContentWorker.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/UploadContentWorker.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/UploadContentWorker.kt index f1b60f5ecf..b657d950bd 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/UploadContentWorker.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/content/UploadContentWorker.kt @@ -188,9 +188,6 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter } }) .let { videoCompressionResult -> - if (videoCompressionResult is VideoCompressionResult.CompressionFailed) { - videoCompressionResult.failure.printStackTrace() - } when (videoCompressionResult) { is VideoCompressionResult.Success -> { val compressedFile = videoCompressionResult.compressedFile @@ -217,8 +214,11 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter .also { filesToDelete.add(it) } } VideoCompressionResult.CompressionNotNeeded, - VideoCompressionResult.CompressionCancelled, + VideoCompressionResult.CompressionCancelled -> { + workingFile + } is VideoCompressionResult.CompressionFailed -> { + Timber.e(videoCompressionResult.failure, "Video compression failed") workingFile } }