Skip to content

Commit afccc3f

Browse files
committed
Fix: avoid updating backend state file if an unhandled error has occurred
1 parent 665c657 commit afccc3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/command/meta_backend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,11 +1693,11 @@ func (m *Meta) stateStore_C_s(c *configs.StateStore, cHash int, backendSMgr *cli
16931693
}
16941694
}
16951695
// TODO: handle if input is not enabled
1696-
// TODO: handle if non-default workspace is not used
1697-
} else if err != nil {
1698-
diags = diags.Append(err)
16991696
}
17001697
}
1698+
if diags.HasErrors() {
1699+
return nil, diags
1700+
}
17011701

17021702
// Update backend state file
17031703
if err := backendSMgr.WriteState(s); err != nil {

0 commit comments

Comments
 (0)