fix: Workaround for logged XML format exceptions when failing to parse floats

This commit is contained in:
Chris Cameron
2020-07-24 13:42:11 -04:00
parent d7e890d6c3
commit 7ece973c2f
2 changed files with 7 additions and 16 deletions

View File

@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- Repeater changed to use configured callbacks instead of a dumb event
- Scheduled action callbacks allow a TimeSpan to be returned to delay actions
- Workaround for logged XML format exceptions when failing to parse floats
## [12.1.0] - 2020-07-14
### Added

View File

@@ -177,26 +177,16 @@ namespace ICD.Common.Utils.Xml
public long ReadElementContentAsLong()
{
try
{
return m_Reader.ReadElementContentAsLong();
}
catch (XmlException e)
{
throw new IcdXmlException(e);
}
// ReadElementContentAsLong() logs and throws...
string value = ReadElementContentAsString();
return long.Parse(value);
}
public float ReadElementContentAsFloat()
{
try
{
return m_Reader.ReadElementContentAsFloat();
}
catch (XmlException e)
{
throw new IcdXmlException(e);
}
// ReadElementContentAsFloat() logs and throws...
string value = ReadElementContentAsString();
return float.Parse(value);
}
public bool ReadElementContentAsBoolean()