Skip to content

Commit b36afff

Browse files
committed
Advise if SQL GRANT is needed
1 parent 821a84a commit b36afff

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
@@ -6,7 +6,7 @@ import { Directory } from "./Directory";
66
import { File } from "./File";
77
import { fireOtherStudioAction, OtherStudioAction } from "../../commands/studio";
88
import { StudioOpenDialog } from "../../queries";
9-
import { redirectDotvscodeRoot } from "../../utils/index";
9+
import { outputChannel, redirectDotvscodeRoot } from "../../utils/index";
1010

1111
declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
1212

@@ -125,7 +125,17 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
125125
return results.concat(cspSubfolders);
126126
})
127127
.catch((error) => {
128-
error && console.error(error);
128+
if (error) {
129+
console.log(error);
130+
if (error.errorText.includes(" #5540:")) {
131+
const message = `User '${api.config.username}' cannot list ${
132+
csp ? "web application " + spec : "namespace"
133+
} contents. To resolve this, execute the following SQL in the ${api.config.ns.toUpperCase()} namespace:\n\t GRANT EXECUTE ON %Library.RoutineMgr_StudioOpenDialog TO ${
134+
api.config.username
135+
}`;
136+
outputChannel.appendError(message);
137+
}
138+
}
129139
});
130140
}
131141

0 commit comments

Comments
 (0)