From 22d7d2b3101ce238b09e18f74e329d55382aa066 Mon Sep 17 00:00:00 2001
From: Emile <hanemile@protonmail.com>
Date: Mon, 21 Oct 2019 12:48:00 +0200
Subject: handle errors

---
 src/main.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/main.go b/src/main.go
index 4af5cc4..c13d00c 100644
--- a/src/main.go
+++ b/src/main.go
@@ -26,7 +26,12 @@ func main() {
 	httpServer := setupHTTPServer()
 
 	// Set up the DB connection
-	db = setupDatabase()
+	database, err := setupDatabase()
+	if err != nil {
+		log.Println(err)
+		return
+	}
+	db = database
 
 	// React to system signals
 	signalChannel := make(chan os.Signal, 1)
-- 
cgit 1.4.1