Correctly report backup API errors; ref pterodactyl/panel#2271

This commit is contained in:
Dane Everitt
2020-08-27 19:35:57 -07:00
parent 5f1ceeff90
commit a7ca6b2e34
2 changed files with 4 additions and 6 deletions

View File

@@ -20,13 +20,11 @@ func (s *Server) notifyPanelOfBackup(uuid string, ad *backup.ArchiveDetails, suc
s.Log().WithFields(log.Fields{
"backup": uuid,
"error": err,
}).Error("failed to notify panel of backup status due to internal code error")
}).Error("failed to notify panel of backup status due to wings error")
return err
}
s.Log().WithField("backup", uuid).Warn(rerr.String())
return errors.New(rerr.String())
}
@@ -90,7 +88,7 @@ func (s *Server) Backup(b backup.BackupInterface) error {
if notifyError := s.notifyPanelOfBackup(b.Identifier(), &backup.ArchiveDetails{}, false); notifyError != nil {
s.Log().WithFields(log.Fields{
"backup": b.Identifier(),
"error": err,
"error": notifyError,
}).Warn("failed to notify panel of failed backup state")
}
@@ -102,7 +100,7 @@ func (s *Server) Backup(b backup.BackupInterface) error {
"file_size": 0,
})
return errors.WithStack(err)
return errors.Wrap(err, "error while generating server backup")
}
// Try to notify the panel about the status of this backup. If for some reason this request