From 96117a64b368d582957ca7158e9c425f8a439f4a Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 12 May 2019 21:14:15 +0200 Subject: [PATCH] Add error handling in case server socket fails --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index b2486b1..10a41a6 100644 --- a/main.go +++ b/main.go @@ -43,5 +43,9 @@ func handleMtaConnection(clientConnection *bufio.ReadWriter) { func main() { logger = logging.NewLogger(os.Stdout, os.Stderr, logging.DEBUG) - runServer() + err := runServer() + if err != nil { + logger.Errorf("Could not run server: %s\n", err.Error()) + os.Exit(1) + } }