Merge pull request #2344 from soupdiver/return_error_when_no_logger_is_provided_on_http_server_creation

Returns an error if no logOutput is provided.
This commit is contained in:
James Phillips 2016-09-17 09:10:01 -07:00 committed by GitHub
commit 906c19769f

View File

@ -43,6 +43,10 @@ type HTTPServer struct {
// NewHTTPServers starts new HTTP servers to provide an interface to
// the agent.
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
if config.Ports.HTTPS > 0 {