mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
Change the thrown exceptions to ArgumentOutOfRangeException
This commit is contained in:
@@ -10,11 +10,11 @@ namespace S7.Net.Helper
|
||||
{
|
||||
if (dateTime < Date.IecMinDate)
|
||||
{
|
||||
throw new ArgumentException($"DateTime must be at least {Date.IecMinDate:d}");
|
||||
throw new ArgumentOutOfRangeException($"DateTime must be at least {Date.IecMinDate:d}");
|
||||
}
|
||||
if (dateTime > Date.IecMaxDate)
|
||||
{
|
||||
throw new ArgumentException($"DateTime must be lower than {Date.IecMaxDate:d}");
|
||||
throw new ArgumentOutOfRangeException($"DateTime must be lower than {Date.IecMaxDate:d}");
|
||||
}
|
||||
|
||||
return (ushort)(dateTime - Date.IecMinDate).TotalDays;
|
||||
|
||||
Reference in New Issue
Block a user