Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 7bff28e

Browse files
author
Ian Wehrman
committed
Show what used to be the FileIndexManager too-many-files error dialog on project load if the filesystem watch fails with TOO_MANY_ENTRIES.
1 parent 92ea58b commit 7bff28e

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/filesystem/FileSystem.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ define(function (require, exports, module) {
693693
this._watchEntry(entry, watchedRoot, function (err) {
694694
if (err) {
695695
console.warn("Failed to watch root: ", entry.fullPath, err);
696+
callback(err);
696697
return;
697698
}
698699

src/nls/root/strings.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ define({
6767
// Application error strings
6868
"ERROR_IN_BROWSER_TITLE" : "Oops! {APP_NAME} doesn't run in browsers yet.",
6969
"ERROR_IN_BROWSER" : "{APP_NAME} is built in HTML, but right now it runs as a desktop app so you can use it to edit local files. Please use the application shell in the <b>github.com/adobe/brackets-shell</b> repo to run {APP_NAME}.",
70+
71+
// ProjectManager max files error string
72+
"ERROR_MAX_FILES_TITLE" : "Error Indexing Files",
73+
"ERROR_MAX_FILES" : "The maximum number of files have been indexed. Actions that look up files in the index may function incorrectly.",
7074

7175
// Live Development error strings
7276
"ERROR_LAUNCHING_BROWSER_TITLE" : "Error launching browser",

src/project/ProjectManager.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,13 +873,25 @@ define(function (require, exports, module) {
873873
return updateWelcomeProjectPath(_prefs.getValue("projectPath"));
874874
}
875875

876+
/**
877+
* Error dialog when max files in index is hit
878+
* @return {Dialog}
879+
*/
880+
function _showMaxFilesDialog() {
881+
return Dialogs.showModalDialog(
882+
DefaultDialogs.DIALOG_ID_ERROR,
883+
Strings.ERROR_MAX_FILES_TITLE,
884+
Strings.ERROR_MAX_FILES
885+
);
886+
}
887+
876888
function _watchProjectRoot(rootPath) {
877889
FileSystem.on("change", _fileSystemChange);
878890
FileSystem.on("rename", _fileSystemRename);
879891

880892
FileSystem.watch(FileSystem.getDirectoryForPath(rootPath), _shouldShowName, function (err) {
881-
if (err) {
882-
console.log("Error watching project root: ", rootPath, err);
893+
if (err === FileSystemError.TOO_MANY_ENTRIES) {
894+
_showMaxFilesDialog();
883895
}
884896
});
885897
}

0 commit comments

Comments
 (0)