     }
 }
 
-fileprivate extension Error {
-    var isCancellationError: Bool {
-        get {
-            let potentialCancellationError = self as NSError
-            return potentialCancellationError.domain == NSURLErrorDomain && potentialCancellationError.code == NSURLErrorCancelled
-        }
-    }
-}
-
 let WMFExtendedFileAttributeNameMIMEType = "org.wikimedia.MIMEType"
 
 @objc(WMFImageController)

        }
    }
    
    private func perform(_ block: @escaping (_ moc: NSManagedObjectContext) -> Void) {
        let moc = self.managedObjectContext
        moc.perform {
            block(moc)
        }
    }
    
    @objc public func removePermanentlyCachedImages(groupKey: String, completion: @escaping () -> Void) {
        let fm = self.fileManager
        perform { (moc) in

                return
            }
            for item in group.cacheItems ?? [] {
                
                guard let item = item as? CacheItem, let key = item.key, item.cacheGroups?.count == 1 else {
                    continue
                }
