Skip to content

Commit

Permalink
try without variables and log error for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kuiperda committed Sep 16, 2024
1 parent 2d49493 commit 40184e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/stanza/operator/input/windows/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ func (i *Input) read(ctx context.Context) int {
events, err := i.subscription.Read(i.maxReads)
if err != nil {
i.Logger().Error("Failed to read events from subscription", zap.Error(err))
if i.isRemote() {
i.Logger().Info("The error is:")
i.Logger().Info(err.Error())
if i.isRemote() && (err.Error() == "The handle is invalid." || err.Error() == "subscription handle is not open") {
i.Logger().Info("Resubscribing, closing subscription")
closeErr := i.subscription.Close()
if closeErr != nil {
Expand Down

0 comments on commit 40184e9

Please sign in to comment.