Skip to content

Commit 3e08638

Browse files
committed
What happens when events stream errors?
1 parent efc79e0 commit 3e08638

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/socket/src/streamingsocket.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ const enabled = !!globalThis.process?.env.SOCKETSERVER_ENABLED;
6868
subscription.unsubscribe();
6969
done();
7070
},
71+
error: (err) => {
72+
// err is an ErrorEvent but we don't get types for that
73+
const error = err.error;
74+
done.fail(
75+
`Unexpected error in events stream: "${error.message}" / "${error.message}" / "${error.stack}" / JSON=${JSON.stringify(err)} (${err})`,
76+
);
77+
},
7178
});
7279

7380
(async () => {

0 commit comments

Comments
 (0)