mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-11-18 21:40:30 +00:00
Add encryptionNotSupported error for 7z
This commit is contained in:
2 files changed
+6
-1
No files matched your search
@@ -39,4 +39,5 @@ public enum SevenZipError: Error {
|
||||
case noPackInfoFound
|
||||
case streamOverread
|
||||
case dataIsUnavailable
|
||||
case encryptionNotSupported
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user