Skip to content

Commit

Permalink
Catch a ThreadAbortException that can occur in the speech synthesizer.
Browse files Browse the repository at this point in the history
Resolves Rollbar #26295.
  • Loading branch information
Tkael committed Jun 29, 2024
1 parent cf7cd0a commit 6e6df13
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SpeechService/SpeechService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,17 @@ public SpeechService()
{
systemSpeechSynth = new SystemSpeechSynthesizer( ref voiceStore, lexiconSchemas );
}
catch ( ThreadAbortException )
{
// Nothing to do here
}
catch ( Exception e )
{
Logging.Error( $"Unable to initialize System.Speech.Synthesis.SpeechSynthesizer, {RuntimeInformation.OSDescription}", e );
Logging.Error(
$"Unable to initialize System.Speech.Synthesis.SpeechSynthesizer, {RuntimeInformation.OSDescription}",
e );
}

// Sort results alphabetically by voice name
allVoices = voiceStore.OrderBy(v => v.name).ToList();

Expand Down

0 comments on commit 6e6df13

Please sign in to comment.