diff --git a/ts/src/connections/package.json b/ts/src/connections/package.json index e2160f3a..ecf57b9c 100644 --- a/ts/src/connections/package.json +++ b/ts/src/connections/package.json @@ -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", diff --git a/ts/src/connections/tunnelConnectionBase.ts b/ts/src/connections/tunnelConnectionBase.ts index bc590cfe..22825c49 100644 --- a/ts/src/connections/tunnelConnectionBase.ts +++ b/ts/src/connections/tunnelConnectionBase.ts @@ -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) { @@ -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; } } } diff --git a/ts/src/connections/tunnelConnectionSession.ts b/ts/src/connections/tunnelConnectionSession.ts index 50cf3783..a6ae2538 100644 --- a/ts/src/connections/tunnelConnectionSession.ts +++ b/ts/src/connections/tunnelConnectionSession.ts @@ -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 { diff --git a/ts/src/management/package.json b/ts/src/management/package.json index 820119c9..176ba5db 100644 --- a/ts/src/management/package.json +++ b/ts/src/management/package.json @@ -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" } }