mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
fix: Workaround for logged XML format exceptions when failing to parse floats
This commit is contained in:
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Workaround for logged XML format exceptions when failing to parse floats
|
||||||
|
|
||||||
## [8.9.2] - 2020-07-28
|
## [8.9.2] - 2020-07-28
|
||||||
### Changed
|
### Changed
|
||||||
- StringExtensions - fixed an issue with IsNumeric where empty strings would return true
|
- StringExtensions - fixed an issue with IsNumeric where empty strings would return true
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user