Skip to content

Commit

Permalink
match windows err
Browse files Browse the repository at this point in the history
  • Loading branch information
kuiperda committed Sep 19, 2024
1 parent 3c79af6 commit 1f718d1
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() && (err.Error() == "The handle is invalid." || err.Error() == "subscription handle is not open") {
i.Logger().Info("Error is: ", zap.Error(err))
i.Logger().Info("windowserr is: ", zap.Error(windows.ERROR_INVALID_HANDLE))
if i.isRemote() && (errors.Is(err, windows.ERROR_INVALID_HANDLE) || err.Error() == "subscription handle is not open") {
i.Logger().Info("Resubscribing, closing remote subscription")
closeErr := i.subscription.Close()
if closeErr != nil {
Expand Down

0 comments on commit 1f718d1

Please sign in to comment.