From 377c4c65548f1fb27b504d5ea85f12c540c6b52a Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Mon, 18 Jan 2021 06:44:10 +0000 Subject: [PATCH] Stop the process when the server fails to start --- src/mango.cr | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mango.cr b/src/mango.cr index 0d57f63..82f6178 100644 --- a/src/mango.cr +++ b/src/mango.cr @@ -63,7 +63,12 @@ class CLI < Clim Plugin::Downloader.default spawn do - Server.new.start + begin + Server.new.start + rescue e + Logger.fatal e + Process.exit 1 + end end MainFiber.start_and_block