From 2c6fe924e5089b70e0f32dce9fcebc6b158606c6 Mon Sep 17 00:00:00 2001 From: AJ Date: Tue, 18 Nov 2025 16:02:36 -0500 Subject: [PATCH] Remove useless catch-and-rethrow blocks in Toolbox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove empty catch-and-rethrow blocks in Load() and Save() methods that were catching exceptions only to rethrow them without adding any value. This improves code clarity and exception propagation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- CutList/Forms/Toolbox.cs | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/CutList/Forms/Toolbox.cs b/CutList/Forms/Toolbox.cs index 99d896f..ea65c68 100644 --- a/CutList/Forms/Toolbox.cs +++ b/CutList/Forms/Toolbox.cs @@ -32,40 +32,26 @@ namespace CutList.Forms /// public void Load() { - try + if (!File.Exists(ToolsFilePath)) { - if (!File.Exists(ToolsFilePath)) - { - LoadDefaultTools(); - Save(); - } - else - { - var json = File.ReadAllText(ToolsFilePath); - var list = JsonConvert.DeserializeObject>(json); - Tools = list; - } + LoadDefaultTools(); + Save(); } - catch (Exception ex) + else { - throw; + var json = File.ReadAllText(ToolsFilePath); + var list = JsonConvert.DeserializeObject>(json); + Tools = list; } } public void Save() { - try - { - if (Tools == null) - return; + if (Tools == null) + return; - var json = JsonConvert.SerializeObject(Tools, Formatting.Indented); - File.WriteAllText(ToolsFilePath, json); - } - catch (Exception ex) - { - throw; - } + var json = JsonConvert.SerializeObject(Tools, Formatting.Indented); + File.WriteAllText(ToolsFilePath, json); } } } \ No newline at end of file