mirror of
https://github.com/cirruslabs/tart.git
synced 2026-10-21 09:42:13 +02:00
fix(storage): preserve running VM delete errors (#1350)
* fix(storage): preserve running VM delete errors Do not reinterpret RuntimeError.VMIsRunning as a missing VM when the storage wrapper bridges errors through NSError. Refs #1345 * test(storage): initialize running VM lock file * test(storage): hold VM lock in a child process * fix(storage): narrow file-not-found error matching * test(storage): use Swift error-domain regression coverage
This commit is contained in:
@@ -38,7 +38,8 @@ class VMStorageHelper {
|
||||
|
||||
extension NSError {
|
||||
func isFileNotFound() -> Bool {
|
||||
return self.code == NSFileNoSuchFileError || self.code == NSFileReadNoSuchFileError
|
||||
return self.domain == NSCocoaErrorDomain &&
|
||||
(self.code == NSFileNoSuchFileError || self.code == NSFileReadNoSuchFileError)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user