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 ### Changed
- Repeater changed to use configured callbacks instead of a dumb event - Repeater changed to use configured callbacks instead of a dumb event
- Scheduled action callbacks allow a TimeSpan to be returned to delay actions - 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 ## [12.1.0] - 2020-07-14
### Added ### Added

View File

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