Skip to content

Commit 5ef09ac

Browse files
Merge pull request #681 from gjsjohnmurray/fix-678
Improve handling of scenario where user has insufficient privileges
2 parents 75f3ea4 + 7f0b6e4 commit 5ef09ac

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/providers/FileSystemProvider/FileSystemProvider.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { File } from "./File";
77
import { fireOtherStudioAction, OtherStudioAction } from "../../commands/studio";
88
import { StudioOpenDialog } from "../../queries";
99
import { studioOpenDialogFromURI } from "../../utils/FileProviderUtil";
10-
import { redirectDotvscodeRoot, workspaceFolderOfUri } from "../../utils/index";
10+
import { outputChannel, redirectDotvscodeRoot, workspaceFolderOfUri } from "../../utils/index";
1111
import { workspaceState } from "../../extension";
1212

1313
declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
@@ -100,7 +100,17 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
100100
return results.concat(cspSubfolders);
101101
})
102102
.catch((error) => {
103-
error && console.error(error);
103+
if (error) {
104+
console.log(error);
105+
if (error.errorText.includes(" #5540:")) {
106+
const message = `User '${api.config.username}' cannot list ${
107+
csp ? "web application" : "namespace"
108+
} contents. To resolve this, execute the following SQL in the ${api.config.ns.toUpperCase()} namespace:\n\t GRANT EXECUTE ON %Library.RoutineMgr_StudioOpenDialog TO ${
109+
api.config.username
110+
}`;
111+
outputChannel.appendError(message);
112+
}
113+
}
104114
});
105115
}
106116

0 commit comments

Comments
 (0)