-
Notifications
You must be signed in to change notification settings - Fork 498
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
Use nameof instead of strongly typed string #1896
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
($"Could not parse {nameof(Height)}.");
prototype
to nameof(Prototype).ToLower()
Concept ACK. Can you fix the conflict before review? |
@nopara73 Conflicts fixed. |
WalletWasabi/Mono/Option.cs
Outdated
@@ -300,7 +298,7 @@ private OptionValueType ParsePrototype() | |||
string name = Names[i]; | |||
if (name.Length == 0) | |||
{ | |||
throw new ArgumentException("Empty option names are not supported.", "prototype"); | |||
throw new ArgumentException("Empty option names are not supported.", nameof(Prototype).ToLower()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bacause ArgumentException
second parameter is the exact name of param, IMO .ToLower()
is unnecessary even if the original Exception worked like that. These texts are written to the user on the console so changing it won't cause any trouble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other exception messages "prototype"
all lower case was used, that is the only reason I used .ToLower()
. I can remove it if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nopara73 Should we stay with prototype
with lower case in ArgumentException
? The name of the property is Prototype
so that would be the correct one but in the original code it is prototype
.
These messages are written to the console to the user.
No description provided.