mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Fix authentication after communication error (#15747)
Fixes #15746 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
d2b3f68d2e
commit
eadfd58cd1
@ -328,14 +328,16 @@ class GoogleCloudAPI {
|
||||
String format = getFormatForCodec(codec);
|
||||
try {
|
||||
return synthesizeSpeechByGoogle(text, voice, format);
|
||||
} catch (AuthenticationException | CommunicationException e) {
|
||||
logger.warn("Error initializing Google Cloud TTS service: {}", e.getMessage());
|
||||
} catch (AuthenticationException e) {
|
||||
logger.warn("Error authenticating Google Cloud TTS service: {}", e.getMessage());
|
||||
if (oAuthService != null) {
|
||||
oAuthFactory.ungetOAuthService(GoogleTTSService.SERVICE_PID);
|
||||
oAuthService = null;
|
||||
}
|
||||
voices.clear();
|
||||
} catch (CommunicationException e) {
|
||||
logger.warn("Error initializing Google Cloud TTS service: {}", e.getMessage());
|
||||
}
|
||||
voices.clear();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user