aboutsummaryrefslogtreecommitdiff
path: root/src/zip/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/zip/error.rs')
-rw-r--r--src/zip/error.rs20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/zip/error.rs b/src/zip/error.rs
index 3eb68b8..9ec0956 100644
--- a/src/zip/error.rs
+++ b/src/zip/error.rs
@@ -11,15 +11,18 @@ pub enum ZipError {
11 InvalidFileHeaderSignature, 11 InvalidFileHeaderSignature,
12 InvalidCDRSignature, 12 InvalidCDRSignature,
13 13
14 InvalidCompressionMethod, 14 InvalidCompressionMethod(u16),
15 UnsupportedCompressionMethod, 15 UnsupportedCompressionMethod(u16),
16 UnsupportedEncryptionMethod,
16 InvalidDate, 17 InvalidDate,
17 InvalidTime, 18 InvalidTime,
18 InvalidFileName, 19 InvalidFileName,
19 InvalidFileComment, 20 InvalidFileComment,
20 21
21 FileNotFound, 22 FileNotFound,
23 PasswordIsNotSpecified,
22 CompressedDataIsUnseekable, 24 CompressedDataIsUnseekable,
25 EncryptedDataIsUnseekable,
23} 26}
24 27
25impl From<ZipError> for ArchiveError<ZipError> { 28impl From<ZipError> for ArchiveError<ZipError> {
@@ -48,15 +51,24 @@ impl Display for ZipError {
48 write!(f, "Invalid signature of central directory record") 51 write!(f, "Invalid signature of central directory record")
49 } 52 }
50 53
51 Self::InvalidCompressionMethod => writeln!(f, "Invalid compression method"), 54 Self::InvalidCompressionMethod(id) => {
52 Self::UnsupportedCompressionMethod => writeln!(f, "Unsupported compression method"), 55 writeln!(f, "Invalid compression method {}", id)
56 }
57 Self::UnsupportedCompressionMethod(id) => {
58 writeln!(f, "Unsupported compression method {}", id)
59 }
60 Self::UnsupportedEncryptionMethod => {
61 writeln!(f, "Unsupported encryption method")
62 }
53 Self::InvalidDate => write!(f, "Invalid date"), 63 Self::InvalidDate => write!(f, "Invalid date"),
54 Self::InvalidTime => write!(f, "Invalid time"), 64 Self::InvalidTime => write!(f, "Invalid time"),
55 Self::InvalidFileName => write!(f, "Invalid file name"), 65 Self::InvalidFileName => write!(f, "Invalid file name"),
56 Self::InvalidFileComment => write!(f, "Invalid file comment"), 66 Self::InvalidFileComment => write!(f, "Invalid file comment"),
57 67
58 Self::FileNotFound => write!(f, "File not found"), 68 Self::FileNotFound => write!(f, "File not found"),
69 Self::PasswordIsNotSpecified => write!(f, "Password is not specified"),
59 Self::CompressedDataIsUnseekable => write!(f, "Compressed data is unseekable"), 70 Self::CompressedDataIsUnseekable => write!(f, "Compressed data is unseekable"),
71 Self::EncryptedDataIsUnseekable => write!(f, "Encrypted data is unseekable"),
60 } 72 }
61 } 73 }
62} 74}