Skip to content

Commit 6322e29

Browse files
committed
add link to wiki for connection errors
This is mainly for EHOSTUNREACH on macOS, which seems quite common.
1 parent 6a5181e commit 6322e29

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/extension.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,14 @@ async function pickDevice(): Promise<void> {
146146
toastStatusBarMessage(`Connected`);
147147
}
148148
catch (err) {
149-
vscode.window.showErrorMessage(`Failed to connect to ${device.name}: ${err.message}`);
149+
const troubleshoot = 'Troubleshoot';
150+
vscode.window.showErrorMessage(`Failed to connect to ${device.name}: ${err.message}`, troubleshoot)
151+
.then((value) => {
152+
if (value === troubleshoot) {
153+
const wiki = vscode.Uri.parse('https://github.com/ev3dev/vscode-ev3dev-browser/wiki/Troubleshooting')
154+
vscode.commands.executeCommand('vscode.open', wiki);
155+
}
156+
});
150157
}
151158
});
152159
}
@@ -783,7 +790,14 @@ class DeviceTreeItem extends vscode.TreeItem {
783790
toastStatusBarMessage(`Connected to ${this.label}`);
784791
}
785792
catch (err) {
786-
vscode.window.showErrorMessage(`Failed to connect to ${this.label}: ${err.message}`);
793+
const troubleshoot = 'Troubleshoot';
794+
vscode.window.showErrorMessage(`Failed to connect to ${this.label}: ${err.message}`, troubleshoot)
795+
.then((value) => {
796+
if (value === troubleshoot) {
797+
const wiki = vscode.Uri.parse('https://github.com/ev3dev/vscode-ev3dev-browser/wiki/Troubleshooting')
798+
vscode.commands.executeCommand('vscode.open', wiki);
799+
}
800+
});
787801
}
788802
}
789803

0 commit comments

Comments
 (0)