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
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.23",
"@microsoft/dev-tunnels-management": ">1.1.23",
"@microsoft/dev-tunnels-contracts": ">1.1.24",
"@microsoft/dev-tunnels-management": ">1.1.24",
"@microsoft/dev-tunnels-ssh": "^3.11.36",
"@microsoft/dev-tunnels-ssh-tcp": "^3.11.36",
"uuid": "^3.3.3",
Expand Down
10 changes: 7 additions & 3 deletions ts/src/connections/tunnelConnectionBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class TunnelConnectionBase implements TunnelConnection {
*/
protected set connectionStatus(value: ConnectionStatus) {
if (this.isDisposed && value !== ConnectionStatus.Disconnected) {
this.throwIfDisposed();
this.throwIfDisposed(`ConnectionStatus: ${value}`);
}

if (value === ConnectionStatus.RefreshingTunnelAccessToken && this.status !== ConnectionStatus.Connecting) {
Expand Down Expand Up @@ -168,9 +168,13 @@ export class TunnelConnectionBase implements TunnelConnection {
/**
* Throws CancellationError if the tunnel connection is disposed.
*/
protected throwIfDisposed() {
protected throwIfDisposed(message: string, stack?: string) {
if (this.isDisposed) {
throw new ObjectDisposedError('The tunnel connection is disposed.');
const error = new ObjectDisposedError(`The tunnel connection is disposed. ${message}`);
if (stack) {
error.stack = stack;
}
throw error;
}
}
}
2 changes: 1 addition & 1 deletion ts/src/connections/tunnelConnectionSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ export class TunnelConnectionSession extends TunnelConnectionBase implements Tun
await this.connector.connectSession(isReconnect, options, cancellation);
} catch (e) {
if (e instanceof CancellationError) {
this.throwIfDisposed();
this.throwIfDisposed(`CancelationError: ${e.message}`, e.stack);
}
throw e;
} finally {
Expand Down
2 changes: 1 addition & 1 deletion 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.23",
"@microsoft/dev-tunnels-contracts": ">1.1.24",
"axios": "^1.6.6"
}
}