[VFS] IJPL-150342 Properly report errors during HttpVirtualFile loading instead of throwing an assertion error

GitOrigin-RevId: 2656f06e46560640822d0ea1353203f8a345f8eb
This commit is contained in:
Nikita Katkov
2024-07-16 22:16:42 +02:00
committed by intellij-monorepo-bot
parent 654398f9a7
commit 13360cc5c6

View File

@@ -127,7 +127,21 @@ public final class RemoteFileInfoImpl implements RemoteContentProvider.Downloadi
} }
VfsImplUtil.refreshAndFindFileByPath(LocalFileSystem.getInstance(), localIOFile.toString(), localFile -> { VfsImplUtil.refreshAndFindFileByPath(LocalFileSystem.getInstance(), localIOFile.toString(), localFile -> {
LOG.assertTrue(localFile != null, "Virtual local file not found for " + localIOFile.getAbsolutePath()); if (localFile == null) {
LOG.warn("Virtual local file not found for " + localIOFile.getAbsolutePath());
var errorMessage = IdeCoreBundle.message("vfs.file.not.exist.error", localIOFile.getAbsolutePath());
synchronized (myLock) {
myLocalVirtualFile = null;
myPrevLocalFile = null;
myState = RemoteFileState.ERROR_OCCURRED;
myErrorMessage = errorMessage;
}
for (FileDownloadingListener listener : myListeners) {
listener.errorOccurred(errorMessage);
}
return;
}
LOG.debug("Virtual local file: " + localFile + ", size = " + localFile.getLength()); LOG.debug("Virtual local file: " + localFile + ", size = " + localFile.getLength());
synchronized (myLock) { synchronized (myLock) {
myLocalVirtualFile = localFile; myLocalVirtualFile = localFile;