Replacing static names in exception messages with nameof literal
This commit is contained in:
@@ -29,7 +29,7 @@ public class JsonStateMachine : IStateMachine
|
||||
|
||||
if (FallbackStateForm != null && !FallbackStateForm.IsSubclassOf(typeof(FormBase)))
|
||||
{
|
||||
throw new ArgumentException("FallbackStateForm is not a subclass of FormBase");
|
||||
throw new ArgumentException($"{nameof(FallbackStateForm)} is not a subclass of {nameof(FormBase)}");
|
||||
}
|
||||
|
||||
FilePath = file ?? throw new ArgumentNullException(nameof(file));
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SimpleJsonStateMachine : IStateMachine
|
||||
|
||||
if (FallbackStateForm != null && !FallbackStateForm.IsSubclassOf(typeof(FormBase)))
|
||||
{
|
||||
throw new ArgumentException("FallbackStateForm is not a subclass of FormBase");
|
||||
throw new ArgumentException($"{nameof(FallbackStateForm)} is not a subclass of {nameof(FormBase)}");
|
||||
}
|
||||
|
||||
FilePath = file ?? throw new ArgumentNullException(nameof(file));
|
||||
|
||||
@@ -27,7 +27,7 @@ public class XmlStateMachine : IStateMachine
|
||||
|
||||
if (FallbackStateForm != null && !FallbackStateForm.IsSubclassOf(typeof(FormBase)))
|
||||
{
|
||||
throw new ArgumentException("FallbackStateForm is not a subclass of FormBase");
|
||||
throw new ArgumentException($"{nameof(FallbackStateForm)} is not a subclass of {nameof(FormBase)}");
|
||||
}
|
||||
|
||||
FilePath = file ?? throw new ArgumentNullException(nameof(file));
|
||||
|
||||
Reference in New Issue
Block a user