Unzip: improved error handling

This commit is contained in:
M66B 2022-03-11 21:00:59 +01:00
parent e70fae3478
commit 153b6c8c53
1 changed files with 6 additions and 1 deletions

View File

@ -52,6 +52,7 @@ import com.sun.mail.util.MessageRemovedIOException;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.ArchiveInputStream;
import org.apache.commons.compress.archivers.ArchiveStreamFactory;
import org.apache.commons.compress.archivers.zip.UnsupportedZipFeatureException;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
@ -3528,7 +3529,11 @@ public class MessageHelper {
}
} catch (Throwable ex) {
Log.e(ex);
db.attachment().setWarning(local.id, Log.formatThrowable(ex));
// Unsupported feature encryption used in entry ...
if (ex instanceof UnsupportedZipFeatureException)
db.attachment().setWarning(local.id, ex.getMessage());
else
db.attachment().setWarning(local.id, Log.formatThrowable(ex));
}
}
}