mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(actions): improve errors and logs (#340)
This commit is contained in:
parent
31fbe013ff
commit
402596523d
15 changed files with 315 additions and 418 deletions
|
@ -318,17 +318,17 @@ func (r *Release) DownloadTorrentFile() error {
|
|||
// Write the body to file
|
||||
_, err = io.Copy(tmpFile, resp.Body)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, fmt.Sprintf("error writing downloaded file: %v", tmpFile.Name()))
|
||||
return errors.Wrap(err, "error writing downloaded file: %v", tmpFile.Name())
|
||||
}
|
||||
|
||||
meta, err := metainfo.LoadFromFile(tmpFile.Name())
|
||||
if err != nil {
|
||||
return errors.Wrap(err, fmt.Sprintf("metainfo could not load file contents: %v", tmpFile.Name()))
|
||||
return errors.Wrap(err, "metainfo could not load file contents: %v", tmpFile.Name())
|
||||
}
|
||||
|
||||
torrentMetaInfo, err := meta.UnmarshalInfo()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, fmt.Sprintf("metainfo could not unmarshal info from torrent: %v", tmpFile.Name()))
|
||||
return errors.Wrap(err, "metainfo could not unmarshal info from torrent: %v", tmpFile.Name())
|
||||
}
|
||||
|
||||
r.TorrentTmpFile = tmpFile.Name()
|
||||
|
@ -337,8 +337,6 @@ func (r *Release) DownloadTorrentFile() error {
|
|||
|
||||
// remove file if fail
|
||||
|
||||
//log.Debug().Msgf("successfully downloaded file: %v", tmpFile.Name())
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue