Skip to content

Commit 519126f

Browse files
phucntphucnt
authored andcommitted
fix: improve Google TTS blocked API error message with actionable guidance
1 parent 0179166 commit 519126f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/js/google-tts.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ class GoogleTTS {
112112
}
113113
} catch (err) {
114114
console.error('[Google TTS] Error:', err);
115-
this.onError?.(`Google TTS: ${err.message}`);
115+
let msg = err.message;
116+
if (msg.includes('blocked')) {
117+
msg = 'API blocked — enable "Cloud Text-to-Speech API" in Google Cloud Console';
118+
}
119+
this.onError?.(`Google TTS: ${msg}`);
116120
}
117121

118122
this._processQueue();

0 commit comments

Comments
 (0)