Google Cloud backend errors are not properly caught
Author: zenogantnerCreated Jun 20, 2018Updated Oct 29, 2025
Labelsbug
File "/usr/local/lib/python3.5/dist-packages/stt_measurement-0.0.1-py3.5.egg/stt_measurement/transcriber.py", line 136, in transcribe_wav
File "/usr/local/lib/python3.5/dist-packages/stt_measurement-0.0.1-py3.5.egg/stt_measurement/transcriber.py", line 173, in _sr_call
File "/usr/local/lib/python3.5/dist-packages/speech_recognition/__init__.py", line 955, in recognize_google_cloud
speech_service = build("speech", "v1", credentials=api_credentials, cache_discovery=False)
File "/usr/local/lib/python3.5/dist-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/googleapiclient/discovery.py", line 230, in build
raise e
File "/usr/local/lib/python3.5/dist-packages/googleapiclient/discovery.py", line 222, in build
requested_url, discovery_http, cache_discovery, cache)
File "/usr/local/lib/python3.5/dist-packages/googleapiclient/discovery.py", line 272, in _retrieve_discovery_doc
raise HttpError(resp, content, uri=actual_url)
googleapiclient.errors.HttpError: <HttpError 500 when requesting https://www.googleapis.com/discovery/v1/apis/speech/v1/rest returned "Backend Error">We need to catch googleapiclient.errors.HttpError and re-throw them as RequestError.
Source: Uberi/speech_recognition