We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32059f5 commit d7429f7Copy full SHA for d7429f7
src/validate.rs
@@ -1,5 +1,6 @@
1
use std::cmp::min;
2
use std::io::Error as IoError;
3
+use std::io::ErrorKind::InvalidData;
4
use std::io::{Read, Seek, SeekFrom, Write};
5
6
use crc32fast::Hasher;
@@ -133,7 +134,10 @@ impl<I: Read + Write + Seek> CrcStore<I> {
133
134
if remain == 4 {
135
return self.read_checksum();
136
} else if remain < 4 {
- panic!("internal error");
137
+ return Err(IoError::new(
138
+ InvalidData,
139
+ "internal error: process_segment()",
140
+ ));
141
} else {
142
let body_remain = (remain - 4) as usize;
143
let to_read = min(body_remain, buf_len);
0 commit comments