mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 17:44:52 +01:00
io/region: add chunk coords to error descriptions
This commit is contained in:
parent
1d126ba771
commit
92a9bb3bb3
1 changed files with 5 additions and 3 deletions
|
@ -98,16 +98,18 @@ impl<R: Read + Seek> Region<R> {
|
|||
};
|
||||
|
||||
if seen[coords] {
|
||||
bail!("Duplicate chunk");
|
||||
bail!("Duplicate chunk {:?}", coords);
|
||||
}
|
||||
seen[coords] = true;
|
||||
|
||||
let mut buffer = vec![0; (len as usize) * BLOCKSIZE];
|
||||
reader
|
||||
.read_exact(&mut buffer)
|
||||
.context("Failed to read chunk data")?;
|
||||
.with_context(|| format!("Failed to read data for chunk {:?}", coords))?;
|
||||
let chunk = decode_chunk(&buffer)
|
||||
.with_context(|| format!("Failed to decode data for chunk {:?}", coords))?;
|
||||
|
||||
f(coords, decode_chunk(&buffer)?);
|
||||
f(coords, chunk);
|
||||
|
||||
index += len as u32;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue