mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Merge pull request #11457 from stepancheg:state-file
PiperOrigin-RevId: 726147631
This commit is contained in:
@@ -383,8 +383,12 @@ func (s *StateFile) load(v any, opts LoadOpts) error {
|
||||
}
|
||||
defer s.UnlockOrDie()
|
||||
|
||||
metaBytes, err := os.ReadFile(s.statePath())
|
||||
path := s.statePath()
|
||||
metaBytes, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
// Caller of this function relies on error code, we cannot return new error,
|
||||
// but we need to provide a message with file name.
|
||||
log.Warningf("Error loading state file %q: %v", path, err)
|
||||
return err
|
||||
}
|
||||
return json.Unmarshal(metaBytes, &v)
|
||||
|
||||
Reference in New Issue
Block a user