We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eba07f1 commit 3927630Copy full SHA for 3927630
src/Server.ts
@@ -63,6 +63,8 @@ class Server extends EventEmitter<Server.Events> {
63
* @param [timeout=5000] Maximum time to wait for existing connections to close before forcibly closing them.
64
*/
65
public async close(timeout = 5000): Promise<void> {
66
+ if (!this.server.listening)
67
+ throw new Error("Server is not listening.");
68
this.emit("closing");
69
let timeoutId: NodeJS.Timeout;
70
await Promise.race([
0 commit comments