From 14a9763c73dcbe0e46d602d8437aa46baaf94e88 Mon Sep 17 00:00:00 2001 From: Josip Janzic Date: Fri, 23 Feb 2024 16:39:29 +0000 Subject: [PATCH] Fix crash with tapo cameras not returning 201 --- pkg/tapo/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tapo/client.go b/pkg/tapo/client.go index 5f1f2465..6955fa4d 100644 --- a/pkg/tapo/client.go +++ b/pkg/tapo/client.go @@ -281,7 +281,7 @@ func dial(req *http.Request) (net.Conn, *http.Response, error) { auth := res.Header.Get("WWW-Authenticate") if res.StatusCode != http.StatusUnauthorized || !strings.HasPrefix(auth, "Digest") { - return nil, nil, err + return nil, nil, fmt.Errorf("Expected StatusCode to be %d, received %d", http.StatusUnauthorized, res.StatusCode) } if password == "" {