From 977a8f8c47f608ed7ba23f240610fd32e664a92c Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 20 Mar 2025 16:03:41 +0800 Subject: [PATCH] Log exception when deleting failed --- .../ChromiumBookmarkLoader.cs | 9 ++++++++- .../FirefoxBookmarkLoader.cs | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs index acf863bf0..d1551c598 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/ChromiumBookmarkLoader.cs @@ -200,7 +200,14 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader } // Delete temporary file - try { File.Delete(tempDbPath); } catch { /* Ignore */ } + try + { + File.Delete(tempDbPath); + } + catch (Exception ex) + { + Log.Exception($"Failed to delete temporary favicon DB: {tempDbPath}", ex); + } } catch (Exception ex) { diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs index e638fa825..59fca63ce 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs @@ -85,7 +85,14 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader } // Delete temporary file - try { File.Delete(tempDbPath); } catch { /* Ignore */ } + try + { + File.Delete(tempDbPath); + } + catch (Exception ex) + { + Log.Exception($"Failed to delete temporary favicon DB: {tempDbPath}", ex); + } } catch (Exception ex) { @@ -159,7 +166,14 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader } // Delete temporary file - try { File.Delete(tempDbPath); } catch { /* Ignore */ } + try + { + File.Delete(tempDbPath); + } + catch (Exception ex) + { + Log.Exception($"Failed to delete temporary favicon DB: {tempDbPath}", ex); + } } catch (Exception ex) {