Skip to content

Commit

Permalink
Interpret StatusBadServiceUnsupported to make clear debug logging
Browse files Browse the repository at this point in the history
This is happens on Siemens PLCs when function on the server is not supported
  • Loading branch information
bitomaxsp committed May 22, 2023
1 parent 7cc1c9c commit c263e7c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ func (c *Client) monitor(ctx context.Context) {
// recreate them all if that fails.
res, err := c.transferSubscriptions(ctx, subIDs)
switch {

case errors.Is(err, ua.StatusBadServiceUnsupported):
dlog.Printf("transfer subscriptions not supported. Recreating all subscriptions: %v", err)
subsToRepublish = nil
subsToRecreate = subIDs

case err != nil:
dlog.Printf("transfer subscriptions failed. Recreating all subscriptions: %v", err)
subsToRepublish = nil
Expand Down

0 comments on commit c263e7c

Please sign in to comment.