From 8873d021f1b21e1a0f67bbb16e6ec9b460a07721 Mon Sep 17 00:00:00 2001 From: Ruslan Cheremin Date: Wed, 23 Apr 2025 12:29:08 +0200 Subject: [PATCH] [vfs] adjust exception messages GitOrigin-RevId: 9382e8bc649782e33b47c323bd489ab6ec34a9ff --- .../vfs/newvfs/persistent/PersistentFSImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java index 3ee7bd23c085..1affe3fe5903 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java @@ -1713,14 +1713,19 @@ public final class PersistentFSImpl extends PersistentFS implements Disposable { for (Map.Entry entry : myRoots.entrySet()) { VirtualFileSystemEntry existingRoot = entry.getValue(); if (existingRoot.getId() == rootId) { - String message = - "Duplicate FS roots: " + rootUrl + " / " + entry.getKey() + " id=" + rootId + " valid=" + existingRoot.isValid(); - throw new RuntimeException(message, e); + throw new RuntimeException( + "Tried to create FS root => conflicted with already existing root: " + + "(path='" + path + "', fs=" + fs + ", rootUrl='" + rootUrl + "'), conflicted with existing " + + "(rootUrl='" + entry.getKey() + "', rootId=" + rootId + ", valid=" + existingRoot.isValid() + ")", e); } } + VirtualFileSystemEntry cachedDir = myIdToDirCache.getCachedDir(rootId); + VirtualFileSystemEntry cachedRoot = myIdToDirCache.getCachedRoot(rootId); throw new RuntimeException( - "No root duplication, rootName='" + rootName + "'; rootNameId=" + rootNameId + "; rootId=" + rootId + ";" + - " path='" + path + "'; fs=" + fs + "; rootUrl='" + rootUrl + "'", e); + "Tried to create FS root => conflicted with already existing file: " + + "(path='" + path + "', fs=" + fs + ", rootUrl='" + rootUrl + "') -> " + + "(rootName='" + rootName + "', rootNameId=" + rootNameId + ", rootId=" + rootId + "), " + + "cachedDir: " + cachedDir + ", cachedRoot: " + cachedRoot, e); } incStructuralModificationCount(); markModified = writeRootFields(rootId, rootName, fs.isCaseSensitive(), attributes) != -1;