diff --git a/cmd/server.ts b/cmd/server.ts index 4590513d..2e04b5ec 100644 --- a/cmd/server.ts +++ b/cmd/server.ts @@ -21,6 +21,7 @@ export function serveCommand(options: any, folder: string) { password: options.password, }); httpServer.start().catch((e) => { - console.error(e); + console.error("HTTP Server error", e); + Deno.exit(1); }); } diff --git a/server/http_server.ts b/server/http_server.ts index 8c35d85c..d982505f 100644 --- a/server/http_server.ts +++ b/server/http_server.ts @@ -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}`, );