Skip to content

Commit

Permalink
Better handling of language error
Browse files Browse the repository at this point in the history
  • Loading branch information
cale250 committed Feb 17, 2012
1 parent efd2ff3 commit 5a75cdf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions siriServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,14 @@ def process_compressed_data(self):
del self.speech[finishSpeech.refId]

self.logger.info("Sending flac to google for recognition")
self.httpClient.make_google_request(flacBin, finishSpeech.refId, dictation, language=self.assistant.language, allowCurses=True)

try:
self.httpClient.make_google_request(flacBin, finishSpeech.refId, dictation, language=self.assistant.language, allowCurses=True)
except TypeError:
fail = CommandFailed(reqObject['aceId'])
fail.reason = "Database error"
fail.errorCode = 2
self.send_object(fail)
self.logger.info("Unable to find language record for this assistant. Try turning Siri off and then back on.")

elif ObjectIsCommand(reqObject, CancelRequest):
# this is probably called when we need to kill a plugin
Expand Down

0 comments on commit 5a75cdf

Please sign in to comment.