ipn/ipnlocal: log on DeleteFile error

Updates tailscale/corp#1626

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-04-22 07:47:57 -07:00
parent 6f52fa02a3
commit b03c23d2ed

View File

@ -186,6 +186,10 @@ func (s *peerAPIServer) DeleteFile(baseName string) error {
} }
err := os.Remove(path) err := os.Remove(path)
if err != nil && !os.IsNotExist(err) { if err != nil && !os.IsNotExist(err) {
if pe, ok := err.(*os.PathError); ok {
logf := s.b.logf
logf("peerapi: failed to DeleteFile: %v", pe.Err) // without filename
}
return err return err
} }
return nil return nil