mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat: TimeZone getting an invalid time zone now throws exception with time zone name
This commit is contained in:
@@ -61,7 +61,11 @@ namespace ICD.Common.Utils.TimeZoneInfo
|
||||
|
||||
public static IcdTimeZoneInfo FindSystemTimeZoneById(string timeZoneId)
|
||||
{
|
||||
return s_Cache[timeZoneId];
|
||||
IcdTimeZoneInfo timeZone;
|
||||
if (s_Cache.TryGetValue(timeZoneId, out timeZone))
|
||||
return timeZone;
|
||||
|
||||
throw new KeyNotFoundException(string.Format("Unable to find timezone with id:{0}", timeZoneId));
|
||||
}
|
||||
|
||||
public static bool TryFindSystemTimeZoneById(string timeZoneId, out IcdTimeZoneInfo output)
|
||||
|
||||
Reference in New Issue
Block a user