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 anyhow::{Context, Result};
|
||||||
use indexmap::IndexSet;
|
use indexmap::IndexSet;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use tracing::{debug, error, info};
|
use tracing::{debug, info};
|
||||||
|
|
||||||
use super::common::*;
|
use super::common::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -205,12 +205,12 @@ impl<'a> RegionProcessor<'a> {
|
||||||
|
|
||||||
info!("Processing region files...");
|
info!("Processing region files...");
|
||||||
|
|
||||||
regions.par_iter().for_each(|&coords| {
|
regions.par_iter().try_for_each(|&coords| {
|
||||||
let result = self.process_region(coords);
|
let _ = self
|
||||||
if let Err(err) = &result {
|
.process_region(coords)
|
||||||
error!("Failed to process region {:?}: {:?}", coords, err);
|
.with_context(|| format!("Failed to process region {:?}", coords))?;
|
||||||
}
|
anyhow::Ok(())
|
||||||
});
|
})?;
|
||||||
|
|
||||||
// info!(
|
// info!(
|
||||||
// "Processed region files ({} processed, {} unchanged, {} errors)",
|
// "Processed region files ({} processed, {} unchanged, {} errors)",
|
||||||
|
|
Loading…
Add table
Reference in a new issue