fix: propagate errors instead of panic in list()
When skipCharts=false, errors from list() now properly propagate instead of causing a crash. Uses a closure variable to capture the error and propagates it after withPreparedCharts completes. Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
parent
b2a01c84aa
commit
1d0ffc5615
|
|
@ -643,17 +643,17 @@ func (a *App) ListReleases(c ListConfigProvider) error {
|
|||
var err error
|
||||
|
||||
if !c.SkipCharts() {
|
||||
var listErr error
|
||||
err = run.withPreparedCharts("list", state.ChartPrepareOptions{
|
||||
SkipRepos: true,
|
||||
SkipDeps: true,
|
||||
Concurrency: 2,
|
||||
}, func() {
|
||||
rel, err := a.list(run)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
stateReleases = rel
|
||||
stateReleases, listErr = a.list(run)
|
||||
})
|
||||
if listErr != nil {
|
||||
err = listErr
|
||||
}
|
||||
} else {
|
||||
stateReleases, err = a.list(run)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue