Fix excessive console logging + remove unnecessary try catch (#5860)

This commit is contained in:
Shreya Keshive
2025-08-08 17:48:02 -04:00
committed by GitHub
parent 344ee29f77
commit 9ac62565a0
2 changed files with 9 additions and 14 deletions

View File

@@ -211,16 +211,16 @@ export class IdeClient {
this.state.status === IDEConnectionStatus.Disconnected &&
status === IDEConnectionStatus.Disconnected;
// Only update details if the state wasn't already disconnected, so that
// the first detail message is preserved.
// Only update details & log to console if the state wasn't already
// disconnected, so that the first detail message is preserved.
if (!isAlreadyDisconnected) {
this.state = { status, details };
}
if (status === IDEConnectionStatus.Disconnected) {
if (logToConsole) {
logger.error(details);
}
}
if (status === IDEConnectionStatus.Disconnected) {
logger.debug(details);
ideContext.clearIdeContext();
}