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

Show the complete error message #551

Closed
wants to merge 2 commits into from

Conversation

infofromca
Copy link
Contributor

Fix #549

@infofromca
Copy link
Contributor Author

@sarahelsaig please review it. Maybe this one is better than #550

@@ -6,5 +6,5 @@ namespace OrchardCore.Commerce.Endpoints.Extensions;
public static class ConvertLocalizedHtmlString
{
public static string ConvertLocalizedHtmlStringList(this IReadOnlyList<LocalizedHtmlString> errors) =>
string.Join('\n', errors.Select(error => error.Value));
string.Join(System.Environment.NewLine, errors.Select(error => error.Html()));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
string.Join(System.Environment.NewLine, errors.Select(error => error.Html()));
string.Join(Environment.NewLine, errors.Select(error => error.Html()));

Copy link
Member

Choose a reason for hiding this comment

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

Add using System; on the top

public static class ConvertLocalizedHtmlString
{
public static string ConvertLocalizedHtmlStringList(this IReadOnlyList<LocalizedHtmlString> errors) =>
string.Join('\n', errors.Select(error => error.Value));
string.Join(SystemEnvironment.NewLine, errors.Select(error => error.Html()));
Copy link
Member

Choose a reason for hiding this comment

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

Why not use Environment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OC has it

Copy link
Member

Choose a reason for hiding this comment

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

using Environment = System.Environment;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not working

Copy link
Contributor

Choose a reason for hiding this comment

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

None of this is necessary. Using fully qualified System.Environment.NewLine is appropriate in this scenario.

@sarahelsaig
Copy link
Contributor

sarahelsaig commented Mar 28, 2025

please review it. Maybe this one is better than #550

I like #550 better, the extension method is very specific and not necessary to keep.

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.

Incomplete to show message on API (OCC-335)
3 participants