From 0ac64c3e25769202a23323926c670c1b3beecbe8 Mon Sep 17 00:00:00 2001 From: Kakde Date: Fri, 31 May 2024 12:47:37 +0530 Subject: [PATCH] status code changed --- api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.go b/api.go index 130910b..dfc135e 100644 --- a/api.go +++ b/api.go @@ -96,7 +96,8 @@ func (c *Client) GetVersion() (string, error) { if err != nil { return "", err } - case resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusUnauthorized: + case !(resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices) && resp.StatusCode != http.StatusUnauthorized: + return "", c.api.ParseJSONError(resp) } version, err := extractString(resp)