Skip to content

Fix error printing#86617

Merged
bpasero merged 2 commits intomicrosoft:masterfrom
solomatov:fix_error_printing
Dec 10, 2019
Merged

Fix error printing#86617
bpasero merged 2 commits intomicrosoft:masterfrom
solomatov:fix_error_printing

Conversation

@solomatov
Copy link
Contributor

See #86405 for details

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if exception.message is not defined, let's simply use the generic error message An unknown error occurred. Please consult the log for more details. so that we make sure that even in the verbose case, no undefined message is printed together with the stack.

@bpasero bpasero added this to the On Deck milestone Dec 10, 2019
@solomatov
Copy link
Contributor Author

@bpasero So, it seems that we're repeating what was in the previous PR :-)
Even without message it looks decent. I.e.:

  ERR : Error:
       at stacktrace
       at stacktrace

So, I think, it makes no sense to add a message. It shows a type and empty message after colon.

What do you think?

P.S. I can't reuse the code from spdlogService.ts as @sandy081 suggested, since we use the fact that console allow printing objects in JS representation, and thus more readable than what's available in the file logger.

@solomatov
Copy link
Contributor Author

@bpasero Also, the error isn't unknown, it's Error, it just doesn't have a message.

@bpasero bpasero merged commit 6c6ef0c into microsoft:master Dec 10, 2019
@bpasero
Copy link
Member

bpasero commented Dec 10, 2019

Thanks, I pushed one commit on top. The reason why I think we always want an error message is that these errors might be shown to users and it is not very helpful to have no information provided in that case.

@solomatov
Copy link
Contributor Author

@bpasero That sounds great! Will check whether the error reported correctly.

@solomatov solomatov deleted the fix_error_printing branch December 27, 2019 21:25
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants