Skip to content

Commit bb5ff7a

Browse files
committed
check for monitor server start error
1 parent 94071d3 commit bb5ff7a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

server/server.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,9 @@ func (s *Server) startMonitoring(secure bool) error {
14711471
s.mu.Unlock()
14721472

14731473
go func() {
1474-
srv.Serve(httpListener)
1474+
if err := srv.Serve(httpListener); err != nil {
1475+
s.Fatalf("Error starting monitor on %q: %v", hp, err)
1476+
}
14751477
srv.Handler = nil
14761478
s.mu.Lock()
14771479
s.httpHandler = nil

server/server_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,8 @@ func TestConnectErrorReports(t *testing.T) {
11621162

11631163
remoteURLs := RoutesFromStr("nats://127.0.0.1:1234")
11641164

1165+
s.Shutdown()
1166+
11651167
opts = DefaultOptions()
11661168
opts.ConnectErrorReports = 3
11671169
opts.Cluster.Port = -1

0 commit comments

Comments
 (0)