Make server crash when listening to port fails

This commit is contained in:
Zef Hemel
2022-11-25 13:08:59 +01:00
parent aee071be6a
commit 27a8adf347
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -289,7 +289,10 @@ export class HttpServer {
this.abortController = new AbortController();
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(
`Silver Bullet is now running: http://localhost:${this.port}`,
);