Report errors when start() is called multiple times
This commit is contained in:
parent
83a43fda1e
commit
7b718de77c
1 changed files with 29 additions and 1 deletions
|
|
@ -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, {
|
||||
|
|
|
|||
Loading…
Reference in a new issue