Compare commits

...

2 Commits

Author SHA1 Message Date
Drew Tingen
16fb3683dd chore: Update changelog, increment assembly patch version 2022-06-23 15:07:50 -04:00
Drew Tingen
bb9bcf6cdf feat: TimeZone getting an invalid time zone now throws exception with time zone name 2022-06-23 15:05:45 -04:00
3 changed files with 10 additions and 2 deletions

View File

@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
## [16.0.3] 2022-06-23
### Changed
- Throwing better exception when trying to get unknown timezones
## [16.0.2] 2022-05-23
### Changed
- Fixed an issue in IcdUriBuilder where relative pathes were not being built into a valid URI.

View File

@@ -4,4 +4,4 @@ using System.Reflection;
[assembly: AssemblyCompany("ICD Systems")]
[assembly: AssemblyProduct("ICD.Common.Utils")]
[assembly: AssemblyCopyright("Copyright © ICD Systems 2022")]
[assembly: AssemblyVersion("16.0.2.0")]
[assembly: AssemblyVersion("16.0.3.0")]

View File

@@ -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)