Skip to content

Commit 222677b

Browse files
committed
test(ui): normalize realtime abort rejection
1 parent 27ad38c commit 222677b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎ui/src/pages/chat/realtime-talk-webrtc.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ describe("WebRtcSdpRealtimeTalkTransport", () => {
382382
new Promise<string>((_, reject) => {
383383
offerSignal?.addEventListener(
384384
"abort",
385-
() => reject(offerSignal?.reason ?? new Error("offer request aborted")),
385+
() => {
386+
const reason = offerSignal?.reason;
387+
reject(reason instanceof Error ? reason : new Error("offer request aborted"));
388+
},
386389
{ once: true },
387390
);
388391
}),

0 commit comments

Comments
 (0)