Make server crash when listening to port fails
parent
aee071be6a
commit
27a8adf347
|
@ -21,6 +21,7 @@ export function serveCommand(options: any, folder: string) {
|
||||||
password: options.password,
|
password: options.password,
|
||||||
});
|
});
|
||||||
httpServer.start().catch((e) => {
|
httpServer.start().catch((e) => {
|
||||||
console.error(e);
|
console.error("HTTP Server error", e);
|
||||||
|
Deno.exit(1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,7 +289,10 @@ export class HttpServer {
|
||||||
|
|
||||||
this.abortController = new AbortController();
|
this.abortController = new AbortController();
|
||||||
this.app.listen({ port: this.port, signal: this.abortController.signal })
|
this.app.listen({ port: this.port, signal: this.abortController.signal })
|
||||||
.catch(console.error);
|
.catch((e: any) => {
|
||||||
|
console.log("Server listen error:", e.message);
|
||||||
|
Deno.exit(1);
|
||||||
|
});
|
||||||
console.log(
|
console.log(
|
||||||
`Silver Bullet is now running: http://localhost:${this.port}`,
|
`Silver Bullet is now running: http://localhost:${this.port}`,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue