Skip to content

Commit

Permalink
additional logging for edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ntotten committed Jul 1, 2020
1 parent 17da835 commit c59c4a4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/LoggingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,17 @@ export class LoggingService {
return;
}
this.logMessage(message, "ERROR");
if (error?.message) {
this.logMessage(error.message, "ERROR");
}
if (error?.stack) {
this.outputChannel.appendLine(error.stack);
if (error?.message || error?.stack) {
// Try to print the most useful error message
if (error?.message) {
this.logMessage(error.message, "ERROR");
}
if (error?.stack) {
this.outputChannel.appendLine(error.stack);
}
} else if (error) {
// Weird error returned, just output the whole thing
this.logObject(error);
}
}

Expand Down

0 comments on commit c59c4a4

Please sign in to comment.