fix(customtemplate): duplicated error handling [EE-7197] (#11912)

This commit is contained in:
Oscar Zhou
2024-06-11 22:11:08 +12:00
committed by GitHub
parent c4235c84a7
commit e0934bb7fa
2 changed files with 40 additions and 2 deletions

View File

@@ -70,8 +70,7 @@ func (handler *Handler) customTemplateGitFetch(w http.ResponseWriter, r *http.Re
if err != nil {
log.Warn().Err(err).Msg("failed to download git repository")
if err != nil {
rbErr := rollbackCustomTemplate(backupPath, customTemplate.ProjectPath)
if rbErr := rollbackCustomTemplate(backupPath, customTemplate.ProjectPath); rbErr != nil {
return httperror.InternalServerError("Failed to rollback the custom template folder", rbErr)
}