diff --git a/cmd/fibr/fibr.go b/cmd/fibr/fibr.go index 56fbca3f..57290e4f 100644 --- a/cmd/fibr/fibr.go +++ b/cmd/fibr/fibr.go @@ -17,6 +17,7 @@ import ( "github.com/ViBiOh/fibr/pkg/provider" "github.com/ViBiOh/httputils/v4/pkg/alcotest" "github.com/ViBiOh/httputils/v4/pkg/httputils" + "github.com/ViBiOh/httputils/v4/pkg/logger" "github.com/ViBiOh/httputils/v4/pkg/owasp" "github.com/ViBiOh/httputils/v4/pkg/recoverer" "github.com/ViBiOh/httputils/v4/pkg/server" @@ -52,26 +53,17 @@ func main() { ctx := context.Background() clients, err := newClient(ctx, config) - if err != nil { - slog.ErrorContext(ctx, "clients", "error", err) - os.Exit(1) - } + logger.FatalfOnErr(ctx, err, "clients") defer clients.Close(ctx) adapters, err := newAdapters(config, clients) - if err != nil { - slog.ErrorContext(ctx, "adapters", "error", err) - os.Exit(1) - } + logger.FatalfOnErr(ctx, err, "adapters") endCtx := clients.health.EndCtx() services, err := newServices(endCtx, config, clients, adapters) - if err != nil { - slog.ErrorContext(ctx, "services", "error", err) - os.Exit(1) - } + logger.FatalfOnErr(ctx, err, "services") stopOnDone := Starters{services.amqpThumbnail, services.amqpExif, services.sanitizer} stopOnDone.Start(clients.health.DoneCtx()) diff --git a/go.mod b/go.mod index b637a91b..9461b454 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/ViBiOh/auth/v2 v2.17.0 github.com/ViBiOh/exas v0.7.1 github.com/ViBiOh/flags v1.5.0 - github.com/ViBiOh/httputils/v4 v4.70.0 + github.com/ViBiOh/httputils/v4 v4.70.1 github.com/ViBiOh/vith v0.6.0 github.com/rabbitmq/amqp091-go v1.9.0 github.com/redis/go-redis/v9 v9.3.1 diff --git a/go.sum b/go.sum index ba480946..8c9bc34b 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/ViBiOh/exas v0.7.1 h1:nzh6E1668OFRgoTIJZJa1RybCW64Gd918qi0Z+0Q4WA= github.com/ViBiOh/exas v0.7.1/go.mod h1:MvIWQZXpWgg45Vsde9bMV48Kb0J8frya8vimmrkQ04E= github.com/ViBiOh/flags v1.5.0 h1:nwuFS8tAwtV6rTPpv2pCB+r12WjZYLjluW7yT+SeVpQ= github.com/ViBiOh/flags v1.5.0/go.mod h1:39UMuTnKsIp6walgD8dK99KRCb4DJt9vPtbWehHh1T0= -github.com/ViBiOh/httputils/v4 v4.70.0 h1:w6du+u9499p6xsMheeOoBjlBbrk4nv2Sv15PlQ5QY34= -github.com/ViBiOh/httputils/v4 v4.70.0/go.mod h1:eyQeplQJxuXuxSGnGRr/NwVgu89QI8GUH8Pzl4Gki0A= +github.com/ViBiOh/httputils/v4 v4.70.1 h1:Vz0+24CBkjT8HVreX46txu8rbd/2f7ROximutdL0WJM= +github.com/ViBiOh/httputils/v4 v4.70.1/go.mod h1:cyn0nVJoDaHtY1PiiWcNU6rUeN2zxojf4pwQ4sClrjM= github.com/ViBiOh/vith v0.6.0 h1:bdLmwgqUEWi3ivShtAhtM9gOZlWQzvZi2Z5b0BRSB1U= github.com/ViBiOh/vith v0.6.0/go.mod h1:eRqtDU2uB8g85vll4spbnCV93DHyHNAYwXCMIBH1GuQ= github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w=