Browse Source

better error log

pull/19/head
QLeelulu 7 years ago
parent
commit
4c16678129
  1. 11
      common.go

11
common.go

@ -1,6 +1,7 @@
package cronsun
import (
"fmt"
"os"
"github.com/shunfei/cronsun/conf"
@ -20,22 +21,24 @@ func Init() (err error) {
// init id creator
if err = initID(); err != nil {
return
return fmt.Errorf("Init UUID Generator faild: %s", err)
}
// init config
if err = conf.Init(); err != nil {
return
return fmt.Errorf("Init Config faild: %s", err)
}
// init etcd client
if DefalutClient, err = NewClient(conf.Config); err != nil {
return
return fmt.Errorf("Connect to ETCD %s faild: %s",
conf.Config.Etcd.Endpoints, err)
}
// init mongoDB
if mgoDB, err = db.NewMdb(conf.Config.Mgo); err != nil {
return
return fmt.Errorf("Connect to MongoDB %s faild: %s",
conf.Config.Mgo.Hosts, err)
}
_Uid = os.Getuid()

Loading…
Cancel
Save