Log errors in fetching local temporary file provider path

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-03-15 13:24:28 +01:00
parent 762aee8e41
commit 073db8182b
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -32,6 +32,7 @@ func pathForFileProviderExtData() -> URL? {
func pathForFileProviderTempFilesForDomain(_ domain: NSFileProviderDomain) throws -> URL? {
guard let fpManager = NSFileProviderManager(for: domain) else {
Logger.localFileOps.error("Unable to get file provider manager for domain: \(domain.displayName, privacy: OSLogPrivacy.auto(mask: .hash))")
throw NSFileProviderError(.providerNotFound)
}
@ -41,6 +42,7 @@ func pathForFileProviderTempFilesForDomain(_ domain: NSFileProviderDomain) throw
func localPathForNCFile(ocId: String, fileNameView: String, domain: NSFileProviderDomain) throws -> URL {
guard let fileProviderFilesPathUrl = try pathForFileProviderTempFilesForDomain(domain) else {
Logger.localFileOps.error("Unable to get path for file provider temp files for domain: \(domain.displayName, privacy: OSLogPrivacy.auto(mask: .hash))")
throw URLError(.badURL)
}