Skip to content

Commit

Permalink
Fix up various error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sean- committed Jun 16, 2016
1 parent 9cd44ce commit b82f872
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nomad/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,9 @@ func (s *Server) setupBootstrapHandler() error {
}
consulServices, _, err := consulCatalog.Service(nomadServerServiceName, consul.ServiceTagSerf, consulOpts)
if err != nil {
s.logger.Printf("[WARN] server.consul: failed to query service %+q in Consul datacenter %+q: %v", nomadServerServiceName, dc, err)
mErr.Errors = append(mErr.Errors, fmt.Errorf("unable to query service %q from Consul datacenter %q: %v", nomadServerServiceName, dc, err))
err := fmt.Errorf("failed to query service %q in Consul datacenter %q: %v", nomadServerServiceName, dc, err)
s.logger.Printf("[WARN] server.consul: %v", err)
mErr.Errors = append(mErr.Errors, err)
continue
}

Expand Down Expand Up @@ -552,14 +553,13 @@ func (s *Server) setupBootstrapHandler() error {
// setupConsulSyncer creates Server-mode consul.Syncer which periodically
// executes callbacks on a fixed interval.
func (s *Server) setupConsulSyncer() error {
var mErr multierror.Error
if s.config.ConsulConfig.ServerAutoJoin {
if err := s.setupBootstrapHandler(); err != nil {
mErr.Errors = append(mErr.Errors, err)
return err
}
}

return mErr.ErrorOrNil()
return nil
}

// setupRPC is used to setup the RPC listener
Expand Down

0 comments on commit b82f872

Please sign in to comment.