Store `e` has the last error for delayed reporting.
(&mut self, e: io::Error)
| 931 | |
| 932 | /// Store `e` has the last error for delayed reporting. |
| 933 | fn set_last_error(&mut self, e: io::Error) { |
| 934 | // Recover a checksum mismatch. |
| 935 | let last_error = if e.kind() == io::ErrorKind::InvalidData && e.get_ref().is_some() { |
| 936 | e.into_inner() |
| 937 | .unwrap() |
| 938 | .downcast::<error::ChecksumMismatch>() |
| 939 | .map(|source| error::Traversal::Checksum { |
| 940 | offset: *self.last_commit.expected_offset(), |
| 941 | source: *source, |
| 942 | }) |
| 943 | .unwrap_or_else(|e| io::Error::new(io::ErrorKind::InvalidData, e).into()) |
| 944 | } else { |
| 945 | error::Traversal::from(e) |
| 946 | }; |
| 947 | self.last_error = Some(last_error); |
| 948 | } |
| 949 | |
| 950 | /// If we're still looking for the initial commit, try to use the offset |
| 951 | /// index to advance the segment reader. |
no test coverage detected