From 530b14c7634bd1fdb5958eef42cc304dcb690c5c Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Tue, 10 Dec 2024 12:57:40 +0100 Subject: [PATCH] catch bluesky's down oauth service errors --- js/bluesky.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js/bluesky.js b/js/bluesky.js index 4eba254..cb240af 100644 --- a/js/bluesky.js +++ b/js/bluesky.js @@ -127,7 +127,16 @@ class BlueskyService { await this.auth.signIn(handle); } catch (error) { console.error('[Bluesky] Sign in failed:', error); - this.ui.updateLoginState(false, `Sign in failed: ${error.message || 'Please try again'}`); + + // Check for common service availability errors + if (error.message && ( + error.message.includes('invalid_client_metadata') || + error.message.includes('Failed to resolve OAuth server metadata for issuer: bsky.social') + )) { + this.ui.updateLoginState(false, 'Bluesky service appears to be down. Please try again in a few minutes.'); + } else { + this.ui.updateLoginState(false, `Sign in failed: ${error.message || 'Please try again'}`); + } } }