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

drop [Serializable] from exceptions #762

Merged
merged 2 commits into from Jan 23, 2024

Conversation

SimonCropp
Copy link
Contributor

No description provided.

@SimonCropp SimonCropp added this to the 7.0.0 milestone Jan 22, 2024
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

PR Type: Refactoring

PR Summary: The pull request removes the Serializable attribute from the ApprovalException class and its derived classes, ApprovalMismatchException and ApprovalMissingException. It also refactors the constructors to directly initialize the Received and Approved properties, enforcing immutability.

Decision: Comment

📝 Type: 'Refactoring' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.

General suggestions:

  • Ensure that the removal of serialization capabilities is clearly communicated to consumers of the library, as it may be a breaking change for those who rely on exception serialization.
  • Verify that the new immutability of the Received and Approved properties aligns with the overall design philosophy of the project and does not introduce any unintended side effects.
  • Consider the broader impact of these changes on the codebase, particularly if there are any existing mechanisms or features that depend on the serialization of these exceptions.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

namespace ApprovalTests.Core.Exceptions;

[Serializable]
public class ApprovalException : Exception
public class ApprovalException(string received, string approved) : Exception
Copy link

Choose a reason for hiding this comment

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

suggestion (llm): The constructor now initializes the properties directly, which is a cleaner approach. However, ensure that this change is consistent with the overall design philosophy of the project, especially if immutability of these properties was not a design goal previously.

@SimonCropp SimonCropp merged commit 9e481b4 into master Jan 23, 2024
3 checks passed
@SimonCropp SimonCropp deleted the drop-Serializable]-from-exceptions branch January 23, 2024 01:22
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.

None yet

1 participant