mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
minedmap/tile_renderer: terminate on errors
Only the processing step may fail for individual tiles (when a region is currently being saved when attempting to process it), the other steps should never fail.
This commit is contained in:
parent
155171803d
commit
6a82fcc9b4
1 changed files with 4 additions and 5 deletions
|
@ -265,11 +265,10 @@ impl<'a> TileRenderer<'a> {
|
||||||
fs::create_dir_all(&self.config.tile_dir(TileKind::Map, 0))?;
|
fs::create_dir_all(&self.config.tile_dir(TileKind::Map, 0))?;
|
||||||
|
|
||||||
// Use par_bridge to process items in order (for better use of region cache)
|
// Use par_bridge to process items in order (for better use of region cache)
|
||||||
regions.iter().par_bridge().for_each(|&coords| {
|
regions.iter().par_bridge().try_for_each(|&coords| {
|
||||||
if let Err(err) = self.render_tile(coords) {
|
self.render_tile(coords)
|
||||||
eprintln!("Failed to render tile {:?}: {:?}", coords, err);
|
.with_context(|| format!("Failed to render tile {:?}", coords))
|
||||||
}
|
})?;
|
||||||
});
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue