only show error if there is one

This commit is contained in:
overflowerror 2021-08-14 15:05:08 +02:00
parent 085caf97f4
commit 2783b3b4b0

View file

@ -36,11 +36,11 @@ func migrate(ctx *app.Context, db *gorm.DB) error {
last = err.Error()
}
}
errorString := strings.TrimSpace(errorBuilder.String())
ctx.Log.Errorf("migration error: %v", errorString)
if errorBuilder.Len() == 0 {
return nil
} else {
errorString := strings.TrimSpace(errorBuilder.String())
ctx.Log.Errorf("migration error: %v", errorString)
return errors.New(errorString)
}
}