Fix error handling.

This commit is contained in:
Matthew Chen 2020-08-01 12:28:05 -03:00
parent f825789c7e
commit 50283af0ff

View File

@ -251,8 +251,10 @@ public extension OWSAttachmentDownloads {
attachmentPointer: attachmentPointer)
}
}.ensure(on: .global()) {
if !OWSFileSystem.deleteFileIfExists(url: encryptedFileUrl) {
owsFailDebug("Could not delete encrypted data file.")
do {
try OWSFileSystem.deleteFileIfExists(url: encryptedFileUrl)
} catch {
owsFailDebug("Error: \(error).")
}
}
}