Normalise a listener's rejection reason before routing it to sessionError

This commit is contained in:
2026-08-27 22:41:26 +02:00
parent 0e8f298957
commit a5fe43d7a9
6 changed files with 22 additions and 8 deletions
+3 -2
View File
@@ -218,8 +218,9 @@ exactly 140.
`[EventEmitter.captureRejectionSymbol]`, which lands a rejected `async` listener on `sessionError`
or `serverError` beside the synchronous guard in `emit()`. Dispatching `rawListeners()` from
`emit()` instead needs a cast to call them with the event's argument tuple, which hard rule 4
forbids. `Session.on()` still types its listeners as void-returning, because widening that needs
the same cast — which is why `test/*.test.ts` turns `no-misused-promises` off.
forbids. A rejection reason is `unknown`, so the handler normalises it the way the synchronous
guard does. `Session.on()` still types its listeners as void-returning, because widening that needs
the same cast — which is why `test/*.test.ts` turns off `no-misused-promises` on arguments.
- **The TLS tests build their own self-signed certificate in DER** (`test/tls.test.ts`) instead of
adding a devDependency or shelling out to openssl. Maintainer's call, 2026-08-26: the dev image