From c1236249a204ed0579ad4d3b70ef08e1ab873246 Mon Sep 17 00:00:00 2001 From: Anish Bhanwala Date: Wed, 21 Apr 2021 15:41:12 +0530 Subject: [PATCH] Related to issue #9244 format the error logs. In case where error is logged as console.error(error) it gets stringified to [object Object]. So replaced such occurrences with the format console.error(' failed:', e). Signed-off-by: Anish Bhanwala --- .../debug/src/browser/console/debug-console-items.tsx | 2 +- packages/debug/src/browser/debug-session-manager.ts | 2 +- packages/debug/src/browser/debug-session.tsx | 6 +++--- packages/debug/src/browser/model/debug-thread.tsx | 2 +- .../src/node/debug-adapter-contribution-registry.ts | 10 +++++----- packages/debug/src/node/debug-service-impl.ts | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/debug/src/browser/console/debug-console-items.tsx b/packages/debug/src/browser/console/debug-console-items.tsx index b59589808c87f..a94f0ad3fa5f1 100644 --- a/packages/debug/src/browser/console/debug-console-items.tsx +++ b/packages/debug/src/browser/console/debug-console-items.tsx @@ -201,7 +201,7 @@ export class DebugVariable extends ExpressionContainer { this.elements = undefined; this.session['fireDidChange'](); } catch (error) { - console.error(error); + console.error('setValue failed:', error); } } diff --git a/packages/debug/src/browser/debug-session-manager.ts b/packages/debug/src/browser/debug-session-manager.ts index 90d079220bf1b..b337363392fdf 100644 --- a/packages/debug/src/browser/debug-session-manager.ts +++ b/packages/debug/src/browser/debug-session-manager.ts @@ -178,7 +178,7 @@ export class DebugSessionManager { await this.shell.saveAll(); return true; } catch (error) { - console.error(error); + console.error('saveAll failed:', error); return false; } } diff --git a/packages/debug/src/browser/debug-session.tsx b/packages/debug/src/browser/debug-session.tsx index 6d409be30318a..d5e671bb98004 100644 --- a/packages/debug/src/browser/debug-session.tsx +++ b/packages/debug/src/browser/debug-session.tsx @@ -173,7 +173,7 @@ export class DebugSession implements CompositeTreeElement { try { await thread.pause(); } catch (e) { - console.error(e); + console.error('pauseAll failed:', e); } })()); } @@ -187,7 +187,7 @@ export class DebugSession implements CompositeTreeElement { try { await thread.continue(); } catch (e) { - console.error(e); + console.error('continueAll failed:', e); } })()); } @@ -416,7 +416,7 @@ export class DebugSession implements CompositeTreeElement { const threads = response && response.body && response.body.threads || []; this.doUpdateThreads(threads, stoppedDetails); } catch (e) { - console.error(e); + console.error('updateThreads failed:', e); } }); } diff --git a/packages/debug/src/browser/model/debug-thread.tsx b/packages/debug/src/browser/model/debug-thread.tsx index 939de6679fff8..fe8d8eebad704 100644 --- a/packages/debug/src/browser/model/debug-thread.tsx +++ b/packages/debug/src/browser/model/debug-thread.tsx @@ -155,7 +155,7 @@ export class DebugThread extends DebugThreadData implements TreeElement { } return this.doUpdateFrames(frames); } catch (e) { - console.error(e); + console.error('fetchFrames failed:', e); return []; } finally { if (!cancel.isCancellationRequested) { diff --git a/packages/debug/src/node/debug-adapter-contribution-registry.ts b/packages/debug/src/node/debug-adapter-contribution-registry.ts index e1acc58ef1f81..54c17e995ad86 100644 --- a/packages/debug/src/node/debug-adapter-contribution-registry.ts +++ b/packages/debug/src/node/debug-adapter-contribution-registry.ts @@ -83,7 +83,7 @@ export class DebugAdapterContributionRegistry { const result = await contribution.provideDebugConfigurations(workspaceFolderUri); configurations.push(...result); } catch (e) { - console.error(e); + console.error('provideDebugConfigurations failed:', e); } } } @@ -108,7 +108,7 @@ export class DebugAdapterContributionRegistry { return current; } } catch (e) { - console.error(e); + console.error('resolveDebugConfiguration failed:', e); } } } @@ -133,7 +133,7 @@ export class DebugAdapterContributionRegistry { return current; } } catch (e) { - console.error(e); + console.error('resolveDebugConfigurationWithSubstitutedVariables failed:', e); } } } @@ -152,7 +152,7 @@ export class DebugAdapterContributionRegistry { try { schemas.push(...await contribution.getSchemaAttributes()); } catch (e) { - console.error(e); + console.error('getSchemaAttributes failed:', e); } } } @@ -165,7 +165,7 @@ export class DebugAdapterContributionRegistry { try { schemas.push(...await contribution.getConfigurationSnippets()); } catch (e) { - console.error(e); + console.error('getConfigurationSnippets failed:', e); } } } diff --git a/packages/debug/src/node/debug-service-impl.ts b/packages/debug/src/node/debug-service-impl.ts index dfee75016769d..5d893298845b5 100644 --- a/packages/debug/src/node/debug-service-impl.ts +++ b/packages/debug/src/node/debug-service-impl.ts @@ -83,7 +83,7 @@ export class DebugServiceImpl implements DebugService { try { await this.doStop(session); } catch (e) { - console.error(e); + console.error('terminateDebugSession failed:', e); } })()); }