From a674079818279cfa0111069d5ae73ef6028ea4f6 Mon Sep 17 00:00:00 2001 From: egawata Date: Mon, 31 Jan 2022 21:05:20 +0900 Subject: [PATCH] raise error when failed to open db connection --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index ed3ddb1..d2801df 100644 --- a/main.go +++ b/main.go @@ -30,6 +30,9 @@ func main() { } db, err := contract.Open(cfg.Engine.Driver, cfg.Engine.DSN) + if err != nil { + log.Fatal("failed to open database connection due to: ", err.Error()) + } redis.ListenAndServe(cfg, db) }