You've already forked openaccounting-server
mirror of
https://github.com/openaccounting/oa-server.git
synced 2025-12-09 00:50:59 +13:00
Added log for database connection error
This commit is contained in:
@@ -35,6 +35,9 @@ func main() {
|
|||||||
connectionString := config.User + ":" + config.Password + "@" + config.DatabaseAddress + "/" + config.Database
|
connectionString := config.User + ":" + config.Password + "@" + config.DatabaseAddress + "/" + config.Database
|
||||||
|
|
||||||
db, err := db.NewDB(connectionString)
|
db, err := db.NewDB(connectionString)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(fmt.Errorf("failed to connect to database with: %s", err.Error()))
|
||||||
|
}
|
||||||
|
|
||||||
bc := &util.StandardBcrypt{}
|
bc := &util.StandardBcrypt{}
|
||||||
|
|
||||||
@@ -42,7 +45,6 @@ func main() {
|
|||||||
auth.NewAuthService(db, bc)
|
auth.NewAuthService(db, bc)
|
||||||
|
|
||||||
app, err := api.Init(config.ApiPrefix)
|
app, err := api.Init(config.ApiPrefix)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(fmt.Errorf("failed to create api instance with: %s", err.Error()))
|
log.Fatal(fmt.Errorf("failed to create api instance with: %s", err.Error()))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user