Skip to content

Commit 46bfc29

Browse files
committed
Housekeeping.
1 parent c296e28 commit 46bfc29

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/access-api.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,12 @@ export class AccessApi extends EventEmitter {
409409
// Handle any websocket errors.
410410
ws.addEventListener("error", (event: ErrorEvent): void => {
411411

412-
this.log.error("Events API error: %s", event.error.cause);
413-
this.log.error(util.inspect(event.error, { colors: true, depth: null, sorted: true }));
412+
// Check if this is a TypeError from undici's internal WebSocket handling. They're expected in certain disconnection scenarios.
413+
if(!(event.error instanceof TypeError)) {
414+
415+
this.log.error("Events API error: %s", event.error.cause);
416+
this.log.error(util.inspect(event.error, { colors: true, depth: null, sorted: true }));
417+
}
414418

415419
ws.close();
416420
}, { once: true });

0 commit comments

Comments
 (0)