Remove useless catch-and-rethrow blocks in Toolbox
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 <noreply@anthropic.com>
This commit is contained in:
@@ -31,8 +31,6 @@ namespace CutList.Forms
|
||||
/// Loads the tool list from the file at ToolsFilePath
|
||||
/// </summary>
|
||||
public void Load()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(ToolsFilePath))
|
||||
{
|
||||
@@ -46,15 +44,8 @@ namespace CutList.Forms
|
||||
Tools = list;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Tools == null)
|
||||
return;
|
||||
@@ -62,10 +53,5 @@ namespace CutList.Forms
|
||||
var json = JsonConvert.SerializeObject(Tools, Formatting.Indented);
|
||||
File.WriteAllText(ToolsFilePath, json);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user