Skip to content

Commit c8d5afe

Browse files
committed
Merge pull request #11457 from stepancheg:state-file
PiperOrigin-RevId: 726147631
2 parents 95ad423 + f0ac6d5 commit c8d5afe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runsc/container/state_file.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,12 @@ func (s *StateFile) load(v any, opts LoadOpts) error {
383383
}
384384
defer s.UnlockOrDie()
385385

386-
metaBytes, err := os.ReadFile(s.statePath())
386+
path := s.statePath()
387+
metaBytes, err := os.ReadFile(path)
387388
if err != nil {
389+
// Caller of this function relies on error code, we cannot return new error,
390+
// but we need to provide a message with file name.
391+
log.Warningf("Error loading state file %q: %v", path, err)
388392
return err
389393
}
390394
return json.Unmarshal(metaBytes, &v)

0 commit comments

Comments
 (0)