mirror of https://github.com/status-im/consul.git
return an error if no logOutput is provided
Otherwise the code will panic at a later stage where it is more complicated to figure out what’s actually going on.
This commit is contained in:
parent
b2e867454a
commit
f0eb0ba549
|
@ -43,6 +43,10 @@ type HTTPServer struct {
|
||||||
// NewHTTPServers starts new HTTP servers to provide an interface to
|
// NewHTTPServers starts new HTTP servers to provide an interface to
|
||||||
// the agent.
|
// the agent.
|
||||||
func NewHTTPServers(agent *Agent, config *Config, logOutput io.Writer) ([]*HTTPServer, error) {
|
func NewHTTPServers(agent *Agent, config *Config, logOutput io.Writer) ([]*HTTPServer, error) {
|
||||||
|
if logOutput == nil {
|
||||||
|
return nil, fmt.Errorf("Please provide a valid logOutput(io.Writer)")
|
||||||
|
}
|
||||||
|
|
||||||
var servers []*HTTPServer
|
var servers []*HTTPServer
|
||||||
|
|
||||||
if config.Ports.HTTPS > 0 {
|
if config.Ports.HTTPS > 0 {
|
||||||
|
|
Loading…
Reference in New Issue