catch test error, more logging

This commit is contained in:
Vilsol 2022-06-04 01:33:42 +03:00
parent bdcbb0b677
commit fb1d33cc17

View file

@ -376,6 +376,7 @@ func (i *Installation) Install(ctx *GlobalContext, updates chan InstallUpdate) e
}()
}
log.Info().Str("mod_reference", modReference).Str("version", version.Version).Str("link", version.Link).Msg("downloading mod")
reader, size, err := utils.DownloadOrCache(modReference+"_"+version.Version+".zip", version.Hash, version.Link, genericUpdates)
if err != nil {
return errors.Wrap(err, "failed to download "+modReference+" from: "+version.Link)
@ -383,12 +384,15 @@ func (i *Installation) Install(ctx *GlobalContext, updates chan InstallUpdate) e
downloading = false
log.Info().Str("mod_reference", modReference).Str("version", version.Version).Str("link", version.Link).Msg("extracting mod")
if err := utils.ExtractMod(reader, size, path.Join(modsDirectory, modReference), genericUpdates); err != nil {
return errors.Wrap(err, "could not extract "+modReference)
}
if genericUpdates != nil {
close(genericUpdates)
}
}
completed++
}