Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConsoleLogger will expose ExceptionData #2217

Merged
merged 5 commits into from
Jan 5, 2021

Conversation

eddynaka
Copy link
Collaborator

@eddynaka eddynaka commented Jan 4, 2021

Fixes #2216

if (notification.Exception != null)
{
sb.AppendLine();
sb.AppendLine(JsonConvert.SerializeObject(notification.Exception));
Copy link
Collaborator Author

@eddynaka eddynaka Jan 4, 2021

Choose a reason for hiding this comment

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

JsonConvert.SerializeObject(notification.Exception) [](start = 30, length = 51)

Since Exception isn't an exception class, its an ExceptionData class from sarif, it does not expose a ToString which generate all the fields. With that in mind, I switched to serializing it. #Resolved

Copy link
Member

Choose a reason for hiding this comment

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

Let's write an ExceptionData.ToString() implementation here that mirrors System.Exception.ToString() behavior


In reply to: 551626348 [](ancestors = 551626348)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done! thanks for guiding me!


In reply to: 551649906 [](ancestors = 551649906,551626348)

Copy link
Member

@michaelcfanning michaelcfanning left a comment

Choose a reason for hiding this comment

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

:shipit:

@eddynaka eddynaka enabled auto-merge (squash) January 5, 2021 21:41
@eddynaka eddynaka merged commit 6760c84 into main Jan 5, 2021
@eddynaka eddynaka deleted the users/ednakamu/console-logger-exception-data branch January 5, 2021 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Console logger should emit exception.ToString() for notifications
2 participants