Skip to content

Commit 8e51dda

Browse files
committed
handle error elsewhere
1 parent b89e6aa commit 8e51dda

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

backend/cli/serve.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/labstack/echo/v4"
1111
"github.com/labstack/echo/v4/middleware"
1212
"gorm.io/gorm"
13-
"log"
1413
"net/http"
1514
)
1615

@@ -37,12 +36,12 @@ func commandServe(appConfig config.AppConfig) error {
3736
// Connect to storage backend
3837
storage_backend := storage.DiskController{}.New(appConfig.DataPath)
3938
if err := storage_backend.Setup(); err != nil {
40-
log.Fatalln(err)
39+
return err
4140
}
4241
defer storage_backend.TearDown()
4342
// Connect to database
4443
if err := db.InitDB(appConfig.DB); err != nil {
45-
log.Fatalln(err)
44+
return err
4645
}
4746
// Create server
4847
e := echo.New()

0 commit comments

Comments
 (0)