We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ba433b7 + 49edf8c commit f965022Copy full SHA for f965022
src/transcription/liveTranscription.ts
@@ -36,6 +36,13 @@ export class LiveTranscription extends EventEmitter {
36
};
37
38
this._socket.onclose = (event: WebSocket.CloseEvent) => {
39
+ // changing the event.target to any to access the private _req property that isn't available on the WebSocket.CloseEvent type
40
+ const newTarget: any = event.target;
41
+ if (newTarget["_req"]) {
42
+ const dgErrorIndex =
43
+ newTarget["_req"].res.rawHeaders.indexOf("dg-error");
44
+ event.reason = newTarget["_req"].res.rawHeaders[dgErrorIndex + 1];
45
+ }
46
this.emit(LiveTranscriptionEvents.Close, event);
47
48
0 commit comments