Skip to content

Make it more clear when a server connection failed due to a timeout #1592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,10 @@ export async function checkConnection(
}
if (success) return;
}
if (["ECONNABORTED", "ERR_CANCELED"].includes(error?.code)) {
error = `Request timed out; server took longer than ${serverInfoTimeout} ms to respond.`;
message = `Request timed out after ${serverInfoTimeout} ms`;
}
handleError(
errorMessage ?? error,
`Failed to connect to server '${api.serverId}'. Check your server configuration.`
Expand Down Expand Up @@ -843,9 +847,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
continue;
}
}
for await (const workspaceFolder of vscode.workspace.workspaceFolders ?? []) {
await addWsServerRootFolderData(workspaceFolder.uri);
}
await Promise.allSettled(
vscode.workspace.workspaceFolders?.map((wsFolder) => addWsServerRootFolderData(wsFolder.uri)) || []
);

xmlContentProvider = new XmlContentProvider();

Expand Down Expand Up @@ -1383,9 +1387,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
const serverName = notIsfs(uri) ? config("conn", configName).server : configName;
await resolveConnectionSpec(serverName);
}
for await (const workspaceFolder of added) {
await addWsServerRootFolderData(workspaceFolder.uri);
}
await Promise.allSettled(added.map((wsFolder) => addWsServerRootFolderData(wsFolder.uri)));
}),
vscode.workspace.onDidChangeConfiguration(async ({ affectsConfiguration }) => {
if (affectsConfiguration("objectscript.conn") || affectsConfiguration("intersystems.servers")) {
Expand Down