-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix(.NET): Improve Collection of Errors string #1158
base: main
Are you sure you want to change the base?
Conversation
6cd3bfd
to
5141708
Compare
5141708
to
7969f17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Got 2 new comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public CollectionOfErrors(string message) : base(message) { this.list = new System.Collections.Generic.List<Exception>(); } | ||
public CollectionOfErrors() : base("CollectionOfErrors") { this.list = new System.Collections.Generic.List<Exception>(); } | ||
|
||
private static string ListAsString(List<Exception> list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not importing System.Collections.Generic.List
private static string ListAsString(List<Exception> list) | |
private static string ListAsString(System.Collections.Generic.List<Exception> list) |
Here and other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are missing a import here. Thats why its a blocking comment.
For example: when I try to run this (below) it works but if I remove using System.Collections.Generic
it will give me an error.
using System;
using System.Collections.Generic;
public class HelloWorld
{
public static void Main(string[] args)
{
// Create a new List of strings
List<string> names = new List<string>();
// Add items to the list
names.Add("Alice");
names.Add("Bob");
names.Add("Charlie");
// Print all items in the list
Console.WriteLine("All names:");
foreach (string name in names)
{
Console.WriteLine(name);
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I guess the CI is passing because it only checks for output.Failure?
but not output.error.TypeOfError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you nailed it.
I got it to work for one of the three PRs, and did not verify across all three repos.
Great catch.
Yes. There is no customer impact, so I am not inclined to increase our Beneration scope. |
Issue #, if available:
Collection of Errors is a frustrating error because it requires customer action
to completely serialize it into logs.
We can make a simple fix in .NET to improve the CX,
by always serializing the list into the Collection Of Error's
message.
We concatenate the given error message with
a serialization of all the nested errors.
See similar PR for MPL-Java: 9e195a1
Squash/merge commit message, if applicable:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.