Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@microsoft/dev-tunnels-ssh": "^3.11.36",
"@microsoft/dev-tunnels-ssh-tcp": "^3.11.36",
"await-semaphore": "^0.1.3",
"axios": "^1.6.2",
"axios": "^1.6.6",
"buffer": "^5.2.1",
"debug": "^4.1.1",
"uuid": "^3.3.3",
Expand Down
4 changes: 2 additions & 2 deletions ts/src/connections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"buffer": "^5.2.1",
"debug": "^4.1.1",
"vscode-jsonrpc": "^4.0.0",
"@microsoft/dev-tunnels-contracts": ">1.1.8",
"@microsoft/dev-tunnels-management": ">1.1.8",
"@microsoft/dev-tunnels-contracts": ">1.1.9",
"@microsoft/dev-tunnels-management": ">1.1.9",
"@microsoft/dev-tunnels-ssh": "^3.11.36",
"@microsoft/dev-tunnels-ssh-tcp": "^3.11.36",
"uuid": "^3.3.3",
Expand Down
4 changes: 2 additions & 2 deletions ts/src/management/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"buffer": "^5.2.1",
"debug": "^4.1.1",
"vscode-jsonrpc": "^4.0.0",
"@microsoft/dev-tunnels-contracts": ">1.1.8",
"axios": "^1.6.2"
"@microsoft/dev-tunnels-contracts": ">1.1.9",
"axios": "^1.6.6"
}
}
11 changes: 5 additions & 6 deletions ts/src/management/tunnelManagementHttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,14 +778,13 @@ export class TunnelManagementHttpClient implements TunnelManagementClient {
private getResponseErrorMessage(error: AxiosError, signal: AbortSignal) {
let errorMessage = '';

if (error.code === 'ECONNABORTED') {
// server timeout
errorMessage = `Timeout reached: ${error.message}`;
}

if (signal.aborted) {
// connection timeout
errorMessage = `Signal aborted: ${error.message}`
error.code = 'ECONNABORTED';
errorMessage = `ECONNABORTED: (signal aborted) ${error.message}`
} else if (error.code === 'ECONNABORTED') {
// server timeout
errorMessage = `ECONNABORTED: (timeout) ${error.message}`;
}

if (error.response?.data) {
Expand Down
14 changes: 8 additions & 6 deletions ts/test/tunnels-test/tunnelManagementTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class TunnelManagementTests {
public async timeoutServerResponse() {
this.nextResponse = [];

let error: Error | undefined = undefined;
let error: any | undefined = undefined;
try {
const cts = new CancellationTokenSource();
// Add additional properties on token.
Expand All @@ -135,17 +135,18 @@ export class TunnelManagementTests {
token.forceTimeout = true;
await this.managementClient.listUserLimits(cts.token);
} catch (e) {
error = <Error>e;
error = e;
}

assert(error?.message?.includes('Timeout reached: '));
assert(error?.message?.includes('ECONNABORTED: (timeout)'));
assert(error?.code === 'ECONNABORTED');
}

@test
public async timeoutServerConnection() {
this.nextResponse = [];

let error: Error | undefined = undefined;
let error: any | undefined = undefined;
try {
const cts = new CancellationTokenSource();

Expand All @@ -156,10 +157,11 @@ export class TunnelManagementTests {
token.tokenSource = cts;
await this.managementClient.listUserLimits(cts.token);
} catch (e) {
error = <Error>e;
error = e;
}

assert(error?.message?.includes('Signal aborted: '));
assert(error?.message?.includes('ECONNABORTED: (signal aborted)'));
assert(error?.code === 'ECONNABORTED');
}

@test
Expand Down