Fix error handling with Validate when loading modules (fixes #2658)

The return statement was improperly nested in context.go
This commit is contained in:
Matthew Holt
2019-07-07 14:12:22 -06:00
parent 84f9f7cd60
commit 42acdad9e5
3 changed files with 14 additions and 6 deletions

View File

@ -138,8 +138,8 @@ func (ctx Context) LoadModule(name string, rawMsg json.RawMessage) (interface{},
if err2 != nil {
err = fmt.Errorf("%v; additionally, cleanup: %v", err, err2)
}
return nil, fmt.Errorf("%s: invalid configuration: %v", mod.Name, err)
}
return nil, fmt.Errorf("%s: invalid configuration: %v", mod.Name, err)
}
}