Return Try.Failure instead of throwing exception.

This commit is contained in:
onurays 2020-03-03 13:41:40 +01:00
parent c4f2eeeab7
commit 319667096f

View file

@ -87,7 +87,7 @@ internal class DefaultFileService @Inject constructor(
if (elementToDecrypt != null) {
Timber.v("## decrypt file")
inputStream = MXEncryptedAttachments.decryptAttachment(inputStream, elementToDecrypt)
?: throw IllegalStateException("Decryption error")
?: return@flatMap Try.Failure(IllegalStateException("Decryption error"))
}
writeToFile(inputStream, destFile)