From 8aa4a766e904f209fd68cb41fd6ba32d8d756509 Mon Sep 17 00:00:00 2001 From: Hwangjae Lee Date: Sat, 4 Jan 2025 07:19:09 +0900 Subject: [PATCH] Fix: fix error messages in LoadWrappedFilePV to include file paths Improved error messages in LoadWrappedFilePV by appending file paths. Signed-off-by: Hwangjae Lee --- cmd/babylond/cmd/create_bls_key.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/babylond/cmd/create_bls_key.go b/cmd/babylond/cmd/create_bls_key.go index 37e4f4be4..e8153b80f 100644 --- a/cmd/babylond/cmd/create_bls_key.go +++ b/cmd/babylond/cmd/create_bls_key.go @@ -1,7 +1,6 @@ package cmd import ( - "errors" "fmt" "path/filepath" "strings" @@ -75,10 +74,10 @@ func CreateBlsKey(home string, addr sdk.AccAddress) error { // LoadWrappedFilePV loads the wrapped file private key from the file path. func LoadWrappedFilePV(keyPath, statePath string) (*privval.WrappedFilePV, error) { if !cmtos.FileExists(keyPath) { - return nil, errors.New("validator key file does not exist") + return nil, fmt.Errorf("validator key file does not exist: %s", keyPath) } if !cmtos.FileExists(statePath) { - return nil, errors.New("validator state file does not exist") + return nil, fmt.Errorf("validator state file does not exist: %s", statePath) } return privval.LoadWrappedFilePV(keyPath, statePath), nil }