Report errors when start() is called multiple times

This commit is contained in:
Justin Spahr-Summers 2024-10-16 13:14:47 +01:00
commit 7b718de77c
No known key found for this signature in database

View file

@ -37,7 +37,9 @@ export class SSEServerTransport implements Transport {
*/
async start(): Promise<void> {
if (this._sseResponse) {
throw new Error("Already connected!");
throw new Error(
"SSEServerTransport already started! If using Server class, note that connect() calls start() automatically.",
);
}
this.res.writeHead(200, {