Browse Source

feat:增加启动异常处理

lifei6671 6 years ago
parent
commit
f1b6594c50
1 changed files with 4 additions and 1 deletions
  1. 4 1
      main.go

+ 4 - 1
main.go

@@ -2,6 +2,7 @@ package main
 
 import (
 	"fmt"
+	"log"
 	"os"
 
 	_ "github.com/astaxie/beego/session/memcache"
@@ -36,5 +37,7 @@ func main() {
 		os.Exit(1)
 	}
 
-	s.Run()
+	if err := s.Run(); err != nil {
+		log.Fatal("启动程序失败 ->", err)
+	}
 }