Skip to content

Commit 0ef5926

Browse files
committed
Fix send proper error in proxy
1 parent 20df47a commit 0ef5926

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/local-ssh/proxy.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,8 @@ class WebSocketSSHProxy {
269269
workspaceId: info.workspaceId,
270270
instanceId: info.instanceId,
271271
};
272-
let error: Error;
273-
if (err instanceof Error) {
274-
error = new Error(message + ': ' + err.message);
275-
error.name = err.name;
276-
error.stack = error.stack + '\n\n' + err.stack;
277-
} else {
278-
error = new Error(message + ': ' + err.toString());
279-
}
280-
this.telemetryService.sendTelemetryException(err, properties);
272+
let error = err instanceof Error ? err : new Error(message + ': ' + err.toString());
273+
this.telemetryService.sendTelemetryException(error, properties);
281274
}
282275
}
283276

0 commit comments

Comments
 (0)