Merge pull request #1016 from ckorber/pr/cause_args

Dev: Improve error logs
This commit is contained in:
Tim 2025-10-07 21:24:46 +02:00 committed by GitHub
commit d38cf32773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View file

@ -49,7 +49,7 @@ const useAppleLogin = (): [() => Promise<AppleLoginResponse>, () => 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++;

View file

@ -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++;

View file

@ -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.' }));
}
};
}

View file

@ -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;