Skip to content

Commit 04bd9dd

Browse files
Verify File.Delete exception handling
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 9221435 commit 04bd9dd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,14 @@ private static void DeletePythonBinding()
183183
const string binding = "flowlauncher.py";
184184
foreach (var subDirectory in Directory.GetDirectories(DataLocation.PluginsDirectory))
185185
{
186-
File.Delete(Path.Combine(subDirectory, binding));
186+
try
187+
{
188+
File.Delete(Path.Combine(subDirectory, binding));
189+
}
190+
catch (Exception e)
191+
{
192+
API.LogDebug(ClassName, $"Failed to delete {binding} in {subDirectory}: {e.Message}");
193+
}
187194
}
188195
}
189196

0 commit comments

Comments
 (0)