mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
core/region_processor: make all process_region() error fatal
Less severe errors will be changed not to be passed up to run().
This commit is contained in:
parent
46c04e632f
commit
284892cea6
1 changed files with 7 additions and 7 deletions
|
@ -5,7 +5,7 @@ use std::{ffi::OsStr, path::Path, time::SystemTime};
|
|||
use anyhow::{Context, Result};
|
||||
use indexmap::IndexSet;
|
||||
use rayon::prelude::*;
|
||||
use tracing::{debug, error, info};
|
||||
use tracing::{debug, info};
|
||||
|
||||
use super::common::*;
|
||||
use crate::{
|
||||
|
@ -205,12 +205,12 @@ impl<'a> RegionProcessor<'a> {
|
|||
|
||||
info!("Processing region files...");
|
||||
|
||||
regions.par_iter().for_each(|&coords| {
|
||||
let result = self.process_region(coords);
|
||||
if let Err(err) = &result {
|
||||
error!("Failed to process region {:?}: {:?}", coords, err);
|
||||
}
|
||||
});
|
||||
regions.par_iter().try_for_each(|&coords| {
|
||||
let _ = self
|
||||
.process_region(coords)
|
||||
.with_context(|| format!("Failed to process region {:?}", coords))?;
|
||||
anyhow::Ok(())
|
||||
})?;
|
||||
|
||||
// info!(
|
||||
// "Processed region files ({} processed, {} unchanged, {} errors)",
|
||||
|
|
Loading…
Add table
Reference in a new issue