From 65d320d2e50bfdfe103e6b223968fefb74e55267 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 5 Oct 2026 21:52:30 -0400 Subject: [PATCH] fix(ui): report capture failures in the Plan Cutting dialog Capturing plates runs inside the dialog's message loop, where only argument, operation and not-supported exceptions were caught, so any other capture failure escaped to the editor. Show every capture failure in the summary with Apply disabled instead. --- OpenNest/Forms/CuttingPlanForm.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenNest/Forms/CuttingPlanForm.cs b/OpenNest/Forms/CuttingPlanForm.cs index 4609cab..0e0e09f 100644 --- a/OpenNest/Forms/CuttingPlanForm.cs +++ b/OpenNest/Forms/CuttingPlanForm.cs @@ -165,8 +165,9 @@ public partial class CuttingPlanForm : Form { batch = CuttingPlanBatch.Capture(plates, parameters, keepOrderCheckBox.Checked, plateNumbers); } - catch (Exception ex) when (ex is ArgumentException or InvalidOperationException or NotSupportedException) + catch (Exception ex) { + // Capture runs inside the dialog's message loop: report a failure, never crash the editor. ShowMessage($"Unable to start planning: {ex.Message}"); return; }