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.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/zip/error.rs b/src/zip/error.rs
index 87cd9e9..dbb6bb5 100644
--- a/src/zip/error.rs
+++ b/src/zip/error.rs
@@ -9,9 +9,11 @@ pub enum ZipError {
9 Io(IoError), 9 Io(IoError),
10 10
11 EocdrNotFound, 11 EocdrNotFound,
12 InvalidEOCDR64Signature, 12 InvalidEocdr64Signature,
13 InvalidFileHeaderSignature, 13 InvalidFileHeaderSignature,
14 InvalidCDRSignature, 14 InvalidCdrSignature,
15
16 Overlapping(&'static str, &'static str),
15 17
16 UnsupportedCompressionMethod(u16), 18 UnsupportedCompressionMethod(u16),
17 UnsupportedEncryptionMethod, 19 UnsupportedEncryptionMethod,
@@ -53,8 +55,9 @@ impl Display for ZipError {
53 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 55 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
54 match self { 56 match self {
55 Self::Io(error) => write!(f, "{}", error), 57 Self::Io(error) => write!(f, "{}", error),
58
56 Self::EocdrNotFound => write!(f, "End of central directory record not found"), 59 Self::EocdrNotFound => write!(f, "End of central directory record not found"),
57 Self::InvalidEOCDR64Signature => { 60 Self::InvalidEocdr64Signature => {
58 write!( 61 write!(
59 f, 62 f,
60 "Invalid signature of zip64 end of central directory record" 63 "Invalid signature of zip64 end of central directory record"
@@ -63,12 +66,16 @@ impl Display for ZipError {
63 Self::InvalidFileHeaderSignature => { 66 Self::InvalidFileHeaderSignature => {
64 write!(f, "Invalid file header signature") 67 write!(f, "Invalid file header signature")
65 } 68 }
66 Self::InvalidCDRSignature => { 69 Self::InvalidCdrSignature => {
67 write!(f, "Invalid signature of central directory record") 70 write!(f, "Invalid signature of central directory record")
68 } 71 }
69 72
73 Self::Overlapping(struct1, struct2) => {
74 write!(f, "`{}` overlapt `{}`", struct1, struct2)
75 }
76
70 Self::UnsupportedCompressionMethod(id) => { 77 Self::UnsupportedCompressionMethod(id) => {
71 writeln!(f, "Unsupported compression method {}", id) 78 writeln!(f, "Unsupported compression method `{}`", id)
72 } 79 }
73 Self::UnsupportedEncryptionMethod => { 80 Self::UnsupportedEncryptionMethod => {
74 writeln!(f, "Unsupported encryption method") 81 writeln!(f, "Unsupported encryption method")