From ed55cc3fbf326c8d2f46f7b849a3e6e0d8247b3c Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sat, 29 Feb 2020 00:09:06 -0600 Subject: [PATCH] handle 404 errors --- client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.go b/client.go index 4bf30b3..d313794 100644 --- a/client.go +++ b/client.go @@ -4,6 +4,7 @@ import ( "bytes" //"crypto/tls" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -41,6 +42,8 @@ func (s *Client) Request(method, url string, body io.Reader) ([]Result, error) { } switch resp.StatusCode { + case http.StatusNotFound: + return nil, errors.New("Selector did not match any lights") case http.StatusAccepted: return nil, nil case http.StatusMultiStatus: