wrap topic param validation error

This commit is contained in:
vyzo 2020-03-27 14:15:26 +02:00
parent 1b387b0068
commit bb279e3126
1 changed files with 2 additions and 2 deletions

View File

@ -123,10 +123,10 @@ type TopicScoreParams struct {
// peer score parameter validation // peer score parameter validation
func (p *PeerScoreParams) validate() error { func (p *PeerScoreParams) validate() error {
for _, params := range p.Topics { for topic, params := range p.Topics {
err := params.validate() err := params.validate()
if err != nil { if err != nil {
return err return fmt.Errorf("invalid score parameters for topic %s: %w", topic, err)
} }
} }