MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / set_last_error

Method set_last_error

crates/commitlog/src/commitlog.rs:933–948  ·  view source on GitHub ↗

Store `e` has the last error for delayed reporting.

(&mut self, e: io::Error)

Source from the content-addressed store, hash-verified

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.

Callers 1

next_commitMethod · 0.80

Calls 6

expected_offsetMethod · 0.80
newFunction · 0.50
kindMethod · 0.45
mapMethod · 0.45
unwrapMethod · 0.45
into_innerMethod · 0.45

Tested by

no test coverage detected