From a095b9f3302aaab3e97d1207240c6d4c8afdb36e Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Date: Fri, 31 Jul 2026 06:46:04 +0800 Subject: [PATCH] fix(plex-library-sync): stop masking connection errors --- src/components/Settings/SettingsPlex.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/Settings/SettingsPlex.tsx b/src/components/Settings/SettingsPlex.tsx index 17b24621b..8d5eb8bb3 100644 --- a/src/components/Settings/SettingsPlex.tsx +++ b/src/components/Settings/SettingsPlex.tsx @@ -42,6 +42,7 @@ const messages = defineMessages('components.Settings', { toastPlexRefreshSuccess: 'Plex server list retrieved successfully!', toastPlexRefreshFailure: 'Failed to retrieve Plex server list.', toastPlexSyncFailure: 'Failed to sync Plex libraries.', + invalidurlerror: 'Unable to connect to {mediaServerName} server.', toggleLibraryFailure: 'Failed to update library.', toastPlexConnecting: 'Attempting to connect to Plex…', toastPlexConnectingSuccess: 'Plex connection established successfully!', @@ -244,11 +245,18 @@ const SettingsPlex = ({ isSetupSettings }: SettingsPlexProps) => { try { await axios.post('/api/v1/settings/plex/library/sync'); - } catch { - addToast(intl.formatMessage(messages.toastPlexSyncFailure), { - autoDismiss: true, - appearance: 'error', - }); + } catch (e) { + addToast( + e?.response?.data?.message === 'CONNECTION_ERROR' + ? intl.formatMessage(messages.invalidurlerror, { + mediaServerName: 'Plex', + }) + : intl.formatMessage(messages.toastPlexSyncFailure), + { + autoDismiss: true, + appearance: 'error', + } + ); } finally { setIsSyncing(false); revalidate();