From ff65a8c1159ebe54d6807fa210b7d72ed7ecd3fd Mon Sep 17 00:00:00 2001 From: Andrey Butusov Date: Fri, 29 Nov 2024 20:35:25 +0300 Subject: [PATCH] node: fail gracefully on error from config validation Signed-off-by: Andrey Butusov --- CHANGELOG.md | 1 + cmd/neofs-node/config/config.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecd7b4fe8d..82fe70989a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Changelog for NeoFS Node ### Added ### Fixed +- Fail gracefully on error from config validation (#3037) ### Changed diff --git a/cmd/neofs-node/config/config.go b/cmd/neofs-node/config/config.go index c8ce47e6de..2e6c978b1f 100644 --- a/cmd/neofs-node/config/config.go +++ b/cmd/neofs-node/config/config.go @@ -2,6 +2,7 @@ package config import ( "fmt" + "log" "strings" "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/internal" @@ -58,7 +59,7 @@ func New(_ Prm, opts ...Option) *Config { if o.validate { err := validate.ValidateStruct(v) if err != nil { - panic(err) + log.Fatalf("failed config validation: %v", err) } }