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

This commit is contained in:
Chris Cameron
2020-08-17 10:01:58 -04:00
parent 7f306801b3
commit 34cfe8c7a3
2 changed files with 9 additions and 16 deletions

View File

@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Changed
- Workaround for logged XML format exceptions when failing to parse floats
## [8.9.2] - 2020-07-28
### Changed
- StringExtensions - fixed an issue with IsNumeric where empty strings would return true

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