engine: resources: Ignore cleanup errors that don't matter

If the file is already gone, ignore it.
This commit is contained in:
James Shubin
2023-11-21 00:10:29 -05:00
parent 0c93cf2600
commit b1d61fa90b

View File

@@ -238,7 +238,7 @@ func (obj *NetRes) Cleanup() error {
return fmt.Errorf("socket file should not be the root path")
}
if obj.socketFile != "" { // safety
if err := os.Remove(obj.socketFile); err != nil {
if err := os.Remove(obj.socketFile); err != nil && !os.IsNotExist(err) {
return err
}
}