We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e047afa commit 03ffb45Copy full SHA for 03ffb45
speech/grpc/transcribe_streaming.py
@@ -226,9 +226,11 @@ def main():
226
listen_print_loop(recognize_stream)
227
228
recognize_stream.cancel()
229
- except grpc.RpcError:
230
- # This happens because of the interrupt handler
231
- pass
+ except grpc.RpcError as e:
+ code = e.code()
+ # CANCELLED is caused by the interrupt handler, which is expected.
232
+ if code is not code.CANCELLED:
233
+ raise
234
235
236
if __name__ == '__main__':
0 commit comments