chore: check err before logging (#21133)

This commit is contained in:
Julien Robert 2024-08-02 09:19:44 +02:00 committed by GitHub
parent 23fac2f1b8
commit e507900e45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -184,7 +184,10 @@ func (s *Server[T]) Start(ctx context.Context) error {
// Start a blocking select to wait for an indication to stop the server or that
// the server failed to start properly.
err = <-errCh
s.logger.Error("failed to start gRPC server", "err", err)
if err != nil {
s.logger.Error("failed to start gRPC server", "err", err)
}
return err
}