fix(jar): not returned error on download returns not 200 resp

This commit is contained in:
Mohamad Khani 2024-12-13 15:01:21 +03:30
parent 9b219d967e
commit 08407afe1e

View File

@ -55,7 +55,8 @@ func (jarFile *JarFile) Download() error {
defer out.Close()
resp, err := http.Get(jarFile.uri)
if err != nil {
if err != nil || resp.StatusCode > 200 {
os.Remove(jarFile.filePath)
return err
}