diff --git a/cmd/soroban-rpc/internal/config/options.go b/cmd/soroban-rpc/internal/config/options.go index 9d14084a..9fb80996 100644 --- a/cmd/soroban-rpc/internal/config/options.go +++ b/cmd/soroban-rpc/internal/config/options.go @@ -121,11 +121,9 @@ func (cfg *Config) options() Options { case nil: return nil case string: - return fmt.Errorf( - "could not parse %s: %w", - option.Name, - cfg.LogFormat.UnmarshalText([]byte(v)), - ) + if err := cfg.LogFormat.UnmarshalText([]byte(v)); err != nil { + return fmt.Errorf("could not parse %s: %w", option.Name, err) + } case LogFormat: cfg.LogFormat = v case *LogFormat: