From 40b3260f29f0b6bf83c66ce94e59175abe1b6994 Mon Sep 17 00:00:00 2001 From: Andrey Butusov Date: Tue, 24 Dec 2024 13:12:23 +0300 Subject: [PATCH] ir: improve error messages during configuration validation Now it is clear that the error is related to reading the config. Signed-off-by: Andrey Butusov --- CHANGELOG.md | 1 + cmd/neofs-ir/defaults.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2d5ee3dab..ae5c718ade 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Changelog for NeoFS Node ### Fixed - `neofs-cli object delete` command output (#3056) +- Make the error message more clearer when validating IR configuration (#3072) ### Changed - Number of cuncurrenly handled notifications from the chain was increased from 10 to 300 for IR (#3068) diff --git a/cmd/neofs-ir/defaults.go b/cmd/neofs-ir/defaults.go index 7aec4fac50..ba68230003 100644 --- a/cmd/neofs-ir/defaults.go +++ b/cmd/neofs-ir/defaults.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "strings" "time" @@ -37,7 +38,7 @@ func newConfig(path string) (*viper.Viper, error) { err = validate.ValidateStruct(v) if err != nil { - return nil, err + return nil, fmt.Errorf("failed config validation: %w", err) } return v, nil