     enum Error: Swift.Error {
         case jpegCompressionFailed
         case diskWriteFailed
+        case unknown
     }
 }

        }
        
        do {
            let finalURL = try writeToCache(image: image, request: request)
            self.currentRequest?.handler(finalURL)
        } catch {
            self.currentRequest?.handler(nil)


    }
    
    private func writeToCache(image: UIImage, kind: Kind) throws -> URL {
        guard let data = image.jpegData(compressionQuality: 1) else {
            throw Error.jpegCompressionFailed
        }
        
        let finalURL = cachePathForMedia(kind)
        do {
            try data.write(to: finalURL, options: [.atomic])
            return finalURL
