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

Inherit SekibanCommandHandlerAggregateNullException from ArgumentNullException #208

Open
tkawae opened this issue Jan 8, 2024 · 2 comments
Assignees

Comments

@tkawae
Copy link
Collaborator

tkawae commented Jan 8, 2024

Is your feature request related to a problem? Please describe.
The SekibanCommandHandlerAggregateNullException class may be better off inheriting from the ArgumentNullException class, rather than the Exception class. As a derived class of the ArgumentNullException class, it will be able to perform null checks using ThrowIfNull method of the ArgumentNullException class.

Describe the solution you'd like
Change the definition of the SekibanCommandHandlerAggregateNullExceptionclass as

public class SekibanCommandHandlerAggregateNullException : ArgumentNullException, ISekibanException;
@tkawae tkawae changed the title Inherit the SekibanCommandHandlerAggregateNullException class from the ArgumentNullException class Inherit the SekibanCommandHandlerAggregateNullException from the ArgumentNullException Jan 8, 2024
@tkawae tkawae changed the title Inherit the SekibanCommandHandlerAggregateNullException from the ArgumentNullException Inherit SekibanCommandHandlerAggregateNullException from ArgumentNullException Jan 8, 2024
@tkawae tkawae added this to the Maintenance and Bug Fixes milestone Jan 8, 2024
@tkawae
Copy link
Collaborator Author

tkawae commented Jan 8, 2024

@tomohisa I realized my mistake. If I just inherit from ArgumentNullException, the ThrowIfNull method will throw ArgumentNullException. It would be better to override the ThrowIfNull method, or to stop inheriting from ArgumentNullException and implement ThrowIfNull in SekibanCommandHandlerAggregateNullException.

@tomohisa
Copy link
Contributor

tomohisa commented Jan 8, 2024

stop inheriting from ArgumentNullException and implement ThrowIfNull in SekibanCommandHandlerAggregateNullException.

This seems best to me

@tomohisa tomohisa assigned tomohisa and tkawae and unassigned tomohisa Jan 18, 2024
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

No branches or pull requests

2 participants