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

Add SolutionArgumentException with error types #74

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

edvilme
Copy link
Contributor

@edvilme edvilme commented Nov 14, 2024

Currently it is difficult for users of this library to compare and classify ArgumentExceptions, especially since the messages are formatted, localized strings.
This creates a new class SolutionArgumentException that additionally has a Type property that corresponds to a member of enum SolutionArgumentExceptionType.

@edvilme
Copy link
Contributor Author

edvilme commented Nov 14, 2024

@microsoft-github-policy-service agree company="Microsoft"

Copy link
Contributor

@kasperk81 kasperk81 left a comment

Choose a reason for hiding this comment

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

after this is merged and published need to update source build dotnet/source-build-externals#392 then publish to dotnet9 and 10 feeds, update msbuild and then sdk. (that's one of many reasons i was suggesting to make your life and the sdk implementation simpler and handle this error cases less pedantically)


public class SolutionArgumentException : ArgumentException
{
public readonly SolutionErrorType Type;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public readonly SolutionErrorType Type;
public SolutionErrorType Type { get; init; }

by convention, this should be a readonly property

@richardstanton richardstanton merged commit 445a2f3 into microsoft:main Nov 18, 2024
1 check passed
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.

3 participants