From 5039012fcba94a3e62c36c341c4037c81b56d12f Mon Sep 17 00:00:00 2001 From: jeffvli Date: Wed, 18 Feb 2026 20:54:31 -0800 Subject: [PATCH] catch errors on desktop scrobble notification failure (#1723) --- .../features/player/hooks/use-scrobble.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/renderer/features/player/hooks/use-scrobble.ts b/src/renderer/features/player/hooks/use-scrobble.ts index 3601f3eae..2e16f67e7 100644 --- a/src/renderer/features/player/hooks/use-scrobble.ts +++ b/src/renderer/features/player/hooks/use-scrobble.ts @@ -219,11 +219,20 @@ export const useScrobble = () => { ? currentSong.artists.map((artist) => artist.name).join(' ยท ') : currentSong.artistName; - new Notification(`${currentSong.name}`, { - body: `${artists}\n${currentSong.album}`, - icon: imageUrlRef.current || undefined, - silent: true, - }); + try { + new Notification(`${currentSong.name}`, { + body: `${artists}\n${currentSong.album}`, + icon: imageUrlRef.current || undefined, + silent: true, + }); + } catch (error) { + logFn.error('an error occurred while sending a desktop notification', { + category: LogCategory.SCROBBLE, + meta: { + error: error as Error, + }, + }); + } } }, 1000); }