From 9c0b4fcd5f1dd78e498b73be073871deeaa3d6bd Mon Sep 17 00:00:00 2001 From: Owen Date: Tue, 13 Jan 2026 11:51:51 -0800 Subject: [PATCH] Fix error checking Former-commit-id: 231808476b1087357629b4765285f30900844441 --- websocket/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/websocket/client.go b/websocket/client.go index f620f8a..74b0401 100644 --- a/websocket/client.go +++ b/websocket/client.go @@ -5,6 +5,7 @@ import ( "crypto/tls" "crypto/x509" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -414,7 +415,8 @@ func (c *Client) connectWithRetry() { err := c.establishConnection() if err != nil { // Check if this is an auth error (401/403) - if authErr, ok := err.(*AuthError); ok { + var authErr *AuthError + if errors.As(err, &authErr) { logger.Error("Authentication failed: %v. Terminating tunnel and retrying...", authErr) // Trigger auth error callback if set (this should terminate the tunnel) if c.onAuthError != nil {