<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FileManagerDelegate/fileManager(_:shouldProceedAfterError:removingItemAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSFileManagerDelegate(im)fileManager:shouldProceedAfterError:removingItemAtURL:"
  },
  "title" : "fileManager(_:shouldProceedAfterError:removingItemAt:)"
}
-->

# fileManager(_:shouldProceedAfterError:removingItemAt:)

Asks the delegate if the operation should continue after an error occurs while removing the item at the specified URL.

```
optional func fileManager(_ fileManager: FileManager, shouldProceedAfterError error: any Error, removingItemAt URL: URL) -> Bool
```

## Parameters

`fileManager`

The file manager object that attempted to remove the item.

`error`

The error that occurred while attempting to remove the item at `URL`.

`URL`

The URL for the file or directory that the file manager tried to delete.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the operation should proceed or <doc://com.apple.documentation/documentation/Swift/false> if it should be aborted. If you do not implement this method, the file manager assumes a response of <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The file manager calls this method when there is a problem deleting the item to the specified location. If you return <doc://com.apple.documentation/documentation/Swift/true>, the file manager continues deleting any remaining items and ignores the error.

This method performs the same task as the [`fileManager(_:shouldProceedAfterError:removingItemAtPath:)`](/documentation/Foundation/FileManagerDelegate/fileManager(_:shouldProceedAfterError:removingItemAtPath:)) method and is preferred over that method in macOS 10.6 and later.

## See Also

[`-  removeItemAtPath:error:`](/documentation/Foundation/FileManager/removeItem(atPath:))

Removes the file or directory at the specified path.

[`-  removeItemAtURL:error:`](/documentation/Foundation/FileManager/removeItem(at:))

Removes the file or directory at the specified URL.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)