Add encryptionNotSupported error for 7z

This commit is contained in:
Timofey Solomko committed 2017-07-30 18:36:07 +03:00
1 parent c5877fdc94
commit 5831c5201d
2 files changed
+6 -1

No files matched your search

+1
View File
@@ -39,4 +39,5 @@ public enum SevenZipError: Error {
case noPackInfoFound
case streamOverread
case dataIsUnavailable
case encryptionNotSupported
}
+5 -1
View File
@@ -166,7 +166,11 @@ class SevenZipFolder {
try lzmaDecoder.decodeLZMA(unpackSize, properties[0], dictionarySize)
decodedData = Data(bytes: lzmaDecoder.out)
} else {
throw SevenZipError.compressionNotSupported
if coder.id[0] == 0x06 {
throw SevenZipError.encryptionNotSupported
} else {
throw SevenZipError.compressionNotSupported
}
}
guard decodedData.count == unpackSize