Sfoglia il codice sorgente

fix: remove duplicate code (#75)

Junious_Cheng 4 mesi fa
parent
commit
b27beb5a3d
1 ha cambiato i file con 0 aggiunte e 6 eliminazioni
  1. 0 6
      internal/utils/http_requests/http_warpper.go

+ 0 - 6
internal/utils/http_requests/http_warpper.go

@@ -87,12 +87,6 @@ func RequestAndParseStream[T any](client *http.Client, url string, method string
 		return nil, fmt.Errorf("request failed with status code: %d and respond with: %s", resp.StatusCode, errorText)
 		return nil, fmt.Errorf("request failed with status code: %d and respond with: %s", resp.StatusCode, errorText)
 	}
 	}
 
 
-	if resp.StatusCode != http.StatusOK {
-		defer resp.Body.Close()
-		errorText, _ := io.ReadAll(resp.Body)
-		return nil, fmt.Errorf("request failed with status code: %d and respond with: %s", resp.StatusCode, errorText)
-	}
-
 	ch := stream.NewStream[T](1024)
 	ch := stream.NewStream[T](1024)
 
 
 	// get read timeout
 	// get read timeout