[git-index] unwrap pce thrown during GitIndexVirtualFile creation

GitOrigin-RevId: 0c7e7ac8b90a51d2576c134c36ac28d7fe51803c
This commit is contained in:
Julia Beliaeva
2020-06-10 00:20:23 +03:00
committed by intellij-monorepo-bot
parent ca9d9f0d92
commit b90fd10fe7
@@ -3,7 +3,9 @@ package git4idea.index.vfs
import com.google.common.cache.CacheBuilder
import com.google.common.cache.CacheLoader
import com.google.common.util.concurrent.UncheckedExecutionException
import com.intellij.openapi.Disposable
import com.intellij.openapi.progress.ProcessCanceledException
import com.intellij.openapi.project.Project
import com.intellij.openapi.vcs.FilePath
import com.intellij.openapi.vfs.VirtualFile
@@ -14,7 +16,15 @@ class GitIndexVirtualFileCache(private val project: Project) : Disposable {
})
fun get(root: VirtualFile, filePath: FilePath): GitIndexVirtualFile {
return cache.get(Key(root, filePath))
try {
return cache.get(Key(root, filePath))
} catch (e: UncheckedExecutionException) {
val cause = e.cause
if (cause is ProcessCanceledException) {
throw cause
}
throw e
}
}
fun filesMatching(function: (GitIndexVirtualFile) -> Boolean): List<GitIndexVirtualFile> {