保留素材切分原始失败原因

检查点写入失败时仅记录日志,继续返回图像处理、绑定或裁剪的原始错误。
This commit is contained in:
2026-09-12 21:25:21 +08:00
parent 9052ff14f8
commit be8155c4a8
@@ -157,7 +157,11 @@ pub(crate) async fn separate_ui_impl(
Ok(value) => value,
Err(error) => {
app_log!("ui_separation.error stage=image_edit tree_index={} batch_index={} error={error}", tree_index, batch_index);
write_separation_state(state_path.clone(), &separation).await?;
if let Err(checkpoint_error) =
write_separation_state(state_path.clone(), &separation).await
{
app_log!("ui_separation.error stage=state_checkpoint tree_index={} batch_index={} error={checkpoint_error}", tree_index, batch_index);
}
return Err(error);
}
};
@@ -171,7 +175,11 @@ pub(crate) async fn separate_ui_impl(
Ok(dimensions) => dimensions,
Err(error) => {
app_log!("ui_separation.error stage=processed_image_write tree_index={} batch_index={} error={error}", tree_index, batch_index);
write_separation_state(state_path.clone(), &separation).await?;
if let Err(checkpoint_error) =
write_separation_state(state_path.clone(), &separation).await
{
app_log!("ui_separation.error stage=state_checkpoint tree_index={} batch_index={} error={checkpoint_error}", tree_index, batch_index);
}
return Err(error);
}
};
@@ -187,7 +195,11 @@ pub(crate) async fn separate_ui_impl(
Ok(value) => value,
Err(error) => {
app_log!("ui_separation.error stage=visual_binding tree_index={} batch_index={} error={error}", tree_index, batch_index);
write_separation_state(state_path.clone(), &separation).await?;
if let Err(checkpoint_error) =
write_separation_state(state_path.clone(), &separation).await
{
app_log!("ui_separation.error stage=state_checkpoint tree_index={} batch_index={} error={checkpoint_error}", tree_index, batch_index);
}
return Err(error);
}
};
@@ -232,7 +244,11 @@ pub(crate) async fn separate_ui_impl(
}
if let Some(error) = cut_error {
app_log!("ui_separation.error stage=cut_batch tree_index={} batch_index={} error={error}", tree_index, batch_index);
write_separation_state(state_path.clone(), &separation).await?;
if let Err(checkpoint_error) =
write_separation_state(state_path.clone(), &separation).await
{
app_log!("ui_separation.error stage=state_checkpoint tree_index={} batch_index={} error={checkpoint_error}", tree_index, batch_index);
}
return Err(error);
}
patch::apply_batch_patch(