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

fix/error message missing #5314

Merged
merged 8 commits into from
Sep 4, 2024
Merged

fix/error message missing #5314

merged 8 commits into from
Sep 4, 2024

Conversation

baywet
Copy link
Member

@baywet baywet commented Sep 3, 2024

fixes #5311

This a PR is a follow up to #4930.

Rather than removing the conflicting errorMessage property, we should rename it and keep the primary message property. The renamed property should then set as IsPrimaryErrorMessage so that the derialized information may be propagated up to the Exception/error info.

@andrueastman andrueastman marked this pull request as ready for review September 4, 2024 09:01
@andrueastman andrueastman requested a review from a team as a code owner September 4, 2024 09:01
@andrueastman
Copy link
Member

@baywet I made a few changes here.

I believe that rather that rather than removing the conflicting errorMessage property as we did in #4930, We should rename it and still keep the primary message property.
The renamed property should then set as IsPrimaryErrorMessage so that the deserialized information may be propagated up to the Exception/error info.

This way we get to

  • Resolve conflicts between class/ property names (if collisions exist).
  • Deserialize the data to the property that is escaped so we don't lose the information over the wire.
  • The exception class still gets the message information in the overridden property with thew two properties as below.
        /// <summary>The primary error message.</summary>
        public override string Message { get => MessageEscaped ?? string.Empty; }
        /// <summary>The Message property</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
        public string? MessageEscaped { get; set; }

@baywet
Copy link
Member Author

baywet commented Sep 4, 2024

@andrueastman thanks for your contribution here. I pushed additional commits for the serialization name and the changelog. Ready for review and merge!

Copy link

sonarqubecloud bot commented Sep 4, 2024

Copy link
Member

@andrueastman andrueastman left a comment

Choose a reason for hiding this comment

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

👍🏼

@andrueastman andrueastman merged commit a6aba71 into main Sep 4, 2024
209 checks passed
@andrueastman andrueastman deleted the fix/error-message-missing branch September 4, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Error models with a property called message no longer generate correctly
2 participants