Skip to content

Fix error printing - #86617

Merged
Benjamin Pasero (bpasero) merged 2 commits into
microsoft:masterfrom
solomatov:fix_error_printing
Dec 10, 2019
Merged

Benjamin Pasero (bpasero) merged 2 commits into
microsoft:masterfrom
solomatov:fix_error_printing

Conversation

@solomatov

Copy link
Copy Markdown
Contributor

See #86405 for details

@bpasero Benjamin Pasero (bpasero) left a comment

Copy link
Copy Markdown
Contributor

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 Benjamin Pasero (bpasero) added this to the On Deck milestone Dec 10, 2019
@solomatov

Copy link
Copy Markdown
Contributor Author

Benjamin Pasero (@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 Sandeep Somavarapu (@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
Copy Markdown
Contributor Author

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

@bpasero
Benjamin Pasero (bpasero) merged commit 6c6ef0c into microsoft:master Dec 10, 2019
@bpasero

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Benjamin Pasero (@bpasero) That sounds great! Will check whether the error reported correctly.

@solomatov
Konstantin 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