From a0615bda425c6c4ee79257b7376b2f549b60e373 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 6 Oct 2025 21:50:27 +0200 Subject: [PATCH] Complete addition of cause argument As mentioned in #296 error cast are now added with cause argument. Signed-off-by: Christian --- src/routes/Intro/useAppleLogin.ts | 2 +- src/routes/Intro/useFacebookLogin.ts | 2 +- src/services/Chromecast/ChromecastTransport.js | 4 ++-- src/services/Shell/Shell.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/Intro/useAppleLogin.ts b/src/routes/Intro/useAppleLogin.ts index 6b940e81a..c0278fee8 100644 --- a/src/routes/Intro/useAppleLogin.ts +++ b/src/routes/Intro/useAppleLogin.ts @@ -49,7 +49,7 @@ const useAppleLogin = (): [() => Promise, () => void] => { timeout.current && clearTimeout(timeout.current); timeout.current = setTimeout(() => { if (tries >= MAX_TRIES) - return reject(new Error('Failed to authenticate with Apple')); + return reject(new Error('Failed to authenticate with Apple', { cause: 'Number of allowed tries exceeded!' })); tries++; diff --git a/src/routes/Intro/useFacebookLogin.ts b/src/routes/Intro/useFacebookLogin.ts index 901ca9495..ac14301a5 100644 --- a/src/routes/Intro/useFacebookLogin.ts +++ b/src/routes/Intro/useFacebookLogin.ts @@ -39,7 +39,7 @@ const useFacebookLogin = () => { timeout.current && clearTimeout(timeout.current); timeout.current = setTimeout(() => { if (tries >= MAX_TRIES) - return reject(new Error('Failed to authenticate with facebook')); + return reject(new Error('Failed to authenticate with facebook', { cause: 'Number of allowed tries exceeded!' })); tries++; diff --git a/src/services/Chromecast/ChromecastTransport.js b/src/services/Chromecast/ChromecastTransport.js index 5b3e8b4f1..89c91c5e4 100644 --- a/src/services/Chromecast/ChromecastTransport.js +++ b/src/services/Chromecast/ChromecastTransport.js @@ -21,7 +21,7 @@ const initialize = () => { if (castAPIAvailable) { resolve(); } else { - reject(new Error('window.cast api not available')); + reject(new Error('window.cast api not available', { cause: 'castAPIAvailable is null.' })); } } if (castAPIAvailable !== null) { @@ -167,7 +167,7 @@ function ChromecastTransport() { }); })); } else { - return Promise.reject(new Error('Session not started')); + return Promise.reject(new Error('Session not started', { cause: 'castSession is null.' })); } }; } diff --git a/src/services/Shell/Shell.js b/src/services/Shell/Shell.js index d8f914a83..85d2dafd2 100644 --- a/src/services/Shell/Shell.js +++ b/src/services/Shell/Shell.js @@ -63,7 +63,7 @@ function Shell() { } catch (e) { console.error(e); active = false; - error = new Error(e); + error = new Error('Failed to initialize shell transport', { cause: e }); starting = false; onStateChanged(); transport = null;